Sell = Sellsig AND Ref(Intrade,-1);
-- Cheers Graham Kav AFL Writing Service http://www.aflwriting.com 2008/7/24 Steve Dugas <[EMAIL PROTECTED]>: > Hi - Off the top of my head I don't see how you are getting any Sell signals > but I am probably overlooking something simple and so this seems like a good > example of how looking at your actual arrays can help you to debug, or in > this case, to *understand* how your code is acting on the arrays. You can > plot the arrays but in this case I think explorer might be better ( to avoid > overplotting since all arrays are 1's and 0's ). To see your arrays for the > last year, try adding this to the end of your code, then in AA set N last > quotes to 252 and run an exploration. You should be able to see, day by day, > how the values in the earlier arrays lead to the values in the dependent > arrays... > > Steve > > AddColumn( BuySig, "BuySig", 1.0 ); > AddColumn( SellSig, "SellSig", 1.0 ); > AddColumn( InTrade, "InTrade", 1.0 ); > AddColumn( Ref( InTrade, -1 ), "InTradeShifted", 1.0 ); > AddColumn( Buy, "Buy", 1.0 ); > AddColumn( Sell, "Sell", 1.0 ); > > ----- Original Message ----- > From: "nickrobn" <[EMAIL PROTECTED]> > To: <amibroker@yahoogroups.com> > Sent: Thursday, July 24, 2008 12:00 AM > Subject: [amibroker] Code giving great results > > >> Have following code: >> >> >> Buysig = buy conditions; >> Sellsig = Sell conditions; >> >> InTrade = Flip(Buysig,Sellsig); >> >> Buy = Buysig AND Ref(Intrade,-1)==0; >> Sell = Sellsig AND Ref(Intrade,-1)==0; >> >> I obtain much better results (higher profit, longer and fewer trades) >> with the inclusion of Ref(Intrade,-1)==0 in the formula. Can anyone >> tell me why? >> >> Thanks, >> >> Nick >> >>