Discussions
»
Product and Service Development
»
Formula Assistance
»
Variable Position Sizing in System Tester [RESOLVED]
Rank: Member
Groups: Registered, Registered Users Joined: 11/24/2005(UTC) Posts: 17 Location: Chagrin Falls, Ohio USA
|
I've just performed a simple system test (see code below) whose goal was to examine how the tester dealt with position sizing. The concept is to apply 100% of the available equity when the stock/equity is above the 200 EMA line, and only apply 50% when it is below the 200 EMA line. Simple enough test (I thought)...
BUY ORDER:
[color=blue:dc796233fe]BuyMAF:= Mov(C,OPT1,E);
Cross(C,Ref(BuyMAF,-1))[/color]
Entry Size: % of available Equity
Formula for Entry Size:
[color=blue:dc796233fe]TrendMAF:= Mov(C,200,E);
SizeQ:= C > Ref(TrendMAF,-1);
If(SizeQ,100,50)[/color]
However, when I examine the Orders, Positions, or Equity Tabs, it becomes obvious that no such positioning occurs--in fact, the only positioning was 100% of equity.
Is this a capability that is available in MetaStock, or have I made an error?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/9/2004(UTC) Posts: 107 Location: Salt Lake City, UT
|
Try expressing the % of equity as a decimal value.
If(SizeQ,.99,.5)
That should do the trick.
Doc
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 11/24/2005(UTC) Posts: 17 Location: Chagrin Falls, Ohio USA
|
DOC,
I just tested out your suggestion, and it works! Although the manuals and on-line help say decimal, I mistook what was said. Not to be picky when you're new at a piece of software, but I didn't find any examples. And given what is the normal input in the General Simulation panel, I assumed the entry was in decimal percentage, not decimal fraction.
Thanks much,
Craig
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Variable Position Sizing in System Tester [RESOLVED]
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.