Hi You have a dropline and Increase statements in your formula. Place these before your Conditions.
Dropline=. . . Increase=whatever (ie 5% etc) Condition10 = C < Increase AND Ref(C,-1) > Ref(Increase,-1); -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of M. Smith Sent: Tuesday, 12 December 2006 6:36 AM To: [email protected] Subject: Re: [amibroker] Help with buy formula Dave, would you write that out, I have tried and it still gives me an error, but the error now is related to my change. Please. Thanks. Masrhall ----- Original Message ----- From: Dave <mailto:[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <mailto:[email protected]> ps.com Sent: Monday, December 11, 2006 6:30 AM Subject: RE: [amibroker] Help with buy formula Place your increase statement above your condition statements. -----Original Message----- From: [EMAIL PROTECTED] <mailto:[email protected]> ps.com [mailto:[EMAIL PROTECTED] On Behalf Of M. Smith Sent: Monday, 11 December 2006 1:46 PM To: [EMAIL PROTECTED] <mailto:[email protected]> ps.com Subject: Re: [amibroker] Help with buy formula I loaded this formula and it gave me an error message. "condition 10=c<increase AND Ref(c,-1)>ref increase. Message was variable 'increase' used without having been initialized. Can you help me out, Please. Marshall ----- Original Message ----- From: professor77747 <mailto:[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <mailto:[email protected]> ps.com Sent: Sunday, December 10, 2006 3:23 PM Subject: [amibroker] Help with buy formula When I backtest my formula, all the buys and sells are shown correctly except one. I cannot figure out what is wrong. Here is the buy and sell code: //Buy Signals Condition1 = C > Dropline AND Ref(C,-1) < Ref(Dropline,-1); Cond1=StochK() - Ref(StochK(),-1) >1; Cond2=MACD() > Ref(MACD(),-1); Cond6=StochD()<25; Cond7=BarsSince(Cond6) <=7; //Sell Signals Condition10 = C < Increase AND Ref(C,-1) > Ref(Increase,-1); Cond11=StochK() - Ref(StochK(),-1) < 1; Cond12=MACD() < Ref(MACD(),-1); Cond16=StochD()>75; Cond17=BarsSince(Cond16) <=7; //Buy and Sell orders Buy = BarsSince(Condition1) <=5 AND Cond1 AND Cond7; Sell = BarsSince(Condition10) <=5 AND cond11 AND Cond17; //Short and Cover conditions Short = Sell; Cover=buy; Graham wrote the code for the Condition1 and Condition10. It plots an arrow on the graph so I know that it works. I have checked the stochastic and macd for the buy in question and these are the figures: 3/10 Stok = 20.06 3/13 Stok = 26.42 3/14 Stok = 34.98 3/13 Macd = -1.74 3/14 Macd = -1.54 3/14 Green up arrow The formula should have covered my short and placed a buy. It held my short and did not place a buy. Everything else is perfect except that one day. I have backtested from 9/2/05 and have 12 trades. Thanks, Tom _____ I am using the free version of SPAMfighter for private users. It has removed 570 spam emails to date. Paying users do not have this message in their emails. Try SPAMfighter <http://www.spamfighter.com> for free now! _____ I am using the free version of SPAMfighter for private users. It has removed 574 spam emails to date. Paying users do not have this message in their emails. Try SPAMfighter <http://www.spamfighter.com> for free now!
