[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Advanced Positionsizing Probelm



PureBytes Links

Trading Reference Links

hello,

just to answer myself: i dont need CBT for ATR-based
positionsizing/initial-stops ala vanTharp. Here is what i got and what
seems to work at first glance (just checked a few trades):



SetOption("InitialEquity", 100000);
SetOption("AllowSameBarExit", True);
SetOption("ActivateStopsImmediately", False);
SetOption("FuturesMode", True);

stopamount = 1.5*ATR(12);
stopround = (round(stopamount*10000))/10000;

RoundLotSize = 1;
TickSize = 0.0001;
PointValue = 100000;
MarginDeposit = 1000;

// risk 2% of equity considering the initial-SL
PositionSize = -2 * (1/(stopround*PointValue*MarginDeposit*0.000001));

Buy = Cross( Close, EMA( Close, 45 ) );
Sell = Cross( EMA( Close, 45 ), Close );
Short = Cover = 0;

ApplyStop(stopTypeLoss, stopModePoint, stopround, 1, False);



Ticksize/Pointvalue etc. is set for the forex-market.

Now if i could add a custom metric for Initial Stoploss in Pips and
profit/loss expressed in initial-risk-multiples that would be nice.
But as far as i can see it isnt possible, because i cannot use my
stopamount-array in the CBT-interface. Seems i also cant retrieve the
initial-stop from the trade-object. If anyone knows a way to do that,
any hint would be appreciated.

Andy





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Everything you need is one click away.  Make Yahoo! your home page now.
http://us.click.yahoo.com/AHchtC/4FxNAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/