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

[amibroker] Re: Help with PositionSize setting when backtesting - solved



PureBytes Links

Trading Reference Links


I have worked it out - combination of wrong code and not 
understanding some of the settings options.  Thanks anyway.

--- In amibroker@xxxxxxxxxxxxxxx, "flintox" <flintox@xxxx> wrote:
> 
> Hi
> 
> This is probably a really obvious question, so apologies in 
advance.  
> 
> I am trying to back test a system and set my position sizing per 
> trade based on a maximum loss of $200 per trade, calculated using 
my 
> max stop loss, but when I backtest this, it is not working.  My max 
> losses are all over the place - some are only $15 and others are 
$400 
> so I must have done something wrong.
> 
> Below is my code:
> 
> InitialStop = 2.5*ATR(30);
> TrailStop = 4*ATR(30);
> MaxLoss = 200;
> PositionSize = MaxLoss/InitialStop;
> 
> Sell = 0;
> 
> ApplyStop (stopTypeLoss, stopModePoint, InitialStop, 1, False);
> 
> ApplyStop (stopTypeTrailing, stopModePoint, TrailStop, 1, True);
> 
> Any help would be greatly appreciated.
> 
> Regards
> Sally





------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/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/