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

[amibroker] Re: AFL - Backtest: ExRem



PureBytes Links

Trading Reference Links

Jason, Ara

Using your latest test code, 

Buy = RSI(14)>60;
Sell = RSI(14)<20;
 
Buy=ExRem(Buy,Sell); Sell=ExRem(Sell,Buy);
Cover = Buy; Short = Sell; // )I added this to let it work with my AA 
settings)

before the ExRem statement, Buy has a value of 1 on all the days that 
RSI(14) > 60, and 0 otherwise. After the ExRem, Buy is 1 only on the 
first day that RSI(14) > 60 until a Sell comes along and resets it. 
Sell is similarly treated. So, with the ExRem statement in place, 
there may be no signal on the first day of a back test, and if this 
is so, the backtest report and Equity plot will show that the first 
trade is "Out" until a signal occurs. The net profit figure will 
reflect this also.

A little experiment will illustrate. Try the code above in AA and 
backtest from 3/8/2001 (when there is not a signal). Note that the 
equity plot starts off flat line until several months later, when  
the first signal comes along. Now comment out the ExRem line and run 
again. Note the backtest results are improved and the equity plot 
gets off the horizontal sooner, because as soon as RSI(14) > 60 again 
there is a Buy, and the equity calc starts. Now modify the code to

Buy = RSI(14)>60;
Sell = RSI(14)<20;
Buy = Flip(Buy, Sell); Sell = Flip(Sell, Buy);
 
Buy=ExRem(Buy,Sell); Sell=ExRem(Sell,Buy);
Cover = Buy; Short = Sell;

The Flip makes Buy = 1 every day after the first Buy day until the 
next Sell comes along, and vice versa for Sell. When you try the 
above code you will see the same result as in the first case with the 
ExRem line in place. Now comment out the ExRem line and run again. 
Note that the Equity plot starts right away on 3/8/01, and the 
backtest report shows the first trade as "Long" and the net profit 
figure is increased. This is so because there is definitely a value 
of 1 for Buy on 3/8/01 since the Flip filled in all the days between 
signals and the ExRem did not remove the extras.

I hope this is clear.

Bill


> Ara,
> OK how about this.....
> 
> Buy = RSI(14)>60;
> Sell = RSI(14)<20;
> 
> Buy=ExRem(Buy,Sell);
> Sell=ExRem(Sell,Buy);
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Perhaps I am missing your point but for this example I see no 
difference in
> the results only in the display...
> Regards,
> Jayson
> -----Original Message-----
> From: Ara Kaloustian [mailto:ara1@x...]
> Sent: Thursday, July 17, 2003 12:53 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] AFL - Backtest: ExRem
> 
> 
> Jayson, I see no difference with this code...either arrows of test 
results
> 
> I think you have trades duration so short that no intterfering 
occurances
> take place
>   ----- Original Message -----
>   From: Jayson
>   To: amibroker@xxxxxxxxxxxxxxx
>   Sent: Thursday, July 17, 2003 8:35 AM
>   Subject: RE: [amibroker] AFL - Backtest: ExRem
> 
> 
>   Ara,
> 
>   Running this very simple code...
> 
> 
>   Buy = C>Ref(C,-1);
>   Sell = C<Ref(C,-1);
> 
>   Buy=ExRem(Buy,Sell);
>   Sell=ExRem(Sell,Buy);
> 
>   I see the very same results in  terms of P/L if I comment out the 
exrems
> or leave them in place. With exrem in place I can double click the 
report
> and see the trade arrows reflect actual trades only. with exrem 
commented
> out I see "Raw Signals" displayed. How are you seeing the results 
change?
> 
>   Regards,
>   Jayson
>   -----Original Message-----
>   From: Ara Kaloustian [mailto:ara1@x...]
>   Sent: Thursday, July 17, 2003 2:45 AM
>   To: Ami-Main
>   Subject: [amibroker] AFL - Backtest: ExRem
> 
> 
>   I was under the impression that ExRem commands simply eliminate 
extra
> trade signals that the backtester automatically hadles, so the 
usefullness
> of these commands was to remove extra trade pointer arrows from 
chart.
> 
>   I am using
> 
>   Buy = BuyCommand;
>   Sell  = Sell Comman;
> 
>   Buy = ExRem(Buy,Sell);
> 
>   Sell = ExRem(Sell,Buy);
> 
>   Using / Removing these commands do affect the test results.
> 
>   Would someone explain exactly what they do?
> 
> 
> 
>   Thanks
> 
>   Ara
> 
> 
> 
> 
> 
> 
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
>   (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>   --------------------------------------------
>   Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
>   Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.
> 
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
>   (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>   --------------------------------------------
>   Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
>   Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.
> 
> 
>       Yahoo! Groups Sponsor
>             ADVERTISEMENT
> 
> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more.
http://www.c1tracking.com/l.asp?cid=5510
http://us.click.yahoo.com/GHXcIA/n.WGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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