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

[amibroker] Re: Back test questions


  • Date: Tue, 22 Dec 2009 16:38:49 -0000
  • From: "peter843" <yahoogroups@xxxxxxxxxxxx>
  • Subject: [amibroker] Re: Back test questions

PureBytes Links

Trading Reference Links

> As for the apparent use of stops in your results, do you have any AFL code that is overriding the settings (e.g. ApplyStops)?

No. The sample code I posted produces the issues I discussed. One interesting thing about the stops showing up in the trade column is that many of the trades marked as 'Max loss' were actually profitable.

The first code sample you posted got rid of false stops issue. Most of the trades were closed on the next day as desired. However some were closed a day or two later. That also happened with the second code sample.

When using an nbar stop of 1 all the trades close on the next day.

Thank you for posting the code.


--- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@xxx> wrote:
>
> I believe that either of the two following examples would give you what you want.
> 
> SetTradeDelays(0, 1, 0, 0); // Delay Sell 'till bar after signal
> PositionSize = -10; // invest 10% of portfolio equity in single trade
> 
> RSISignal = RSI(4) < 30;
> 
> Buy = RSISignal;
> BuyPrice = Close;
> 
> Sell = Buy;
> SellPrice = Close;
> 
> /* Option 2
> SetTradeDelays(0, 0, 0, 0);
> PositionSize = -10; // invest 10% of portfolio equity in single trade
> 
> RSISignal = RSI(4) < 30;
> 
> Buy = RSISignal;
> BuyPrice = Close;
> 
> FirstBuy = ExRemSpan(Buy, 1); // Clear redundant buys
> Sell = Ref(FirstBuy, -1); // Sell if bought previous bar
> SellPrice = Close;
> */
> 
> As for the apparent use of stops in your results, do you have any AFL code that is overriding the settings (e.g. ApplyStops)?
> 
> Mike




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/