Hi -- One problem is that you are overwriting two of your variables -- alert and confirm.
The other may be the complexity of the "if" statement. Check the documentation on AddColumn in the AmiBroker Help and try a simpler example. Howard On 7/22/07, tummalaajaybabu <[EMAIL PROTECTED]> wrote:
Hi I have this idea to use this code in exploration with the help of if option. With each if function i have put a addcolumn statement. May be that is not correct one so, i'm getting syntax error. Can anybody help me to correct this formula. Is this correct or any fine tuning suggestions from your side. very much thank you.... Ajay ================ alert = MACD() > Ref(MACD(), -1); Buy = MACD() > Signal(); Confirm = MACD() > 0; alert = MACD() < Ref(MACD(), -1); Sell = MACD() < Signal(); Confirm = MACD() < 0; Filter = C; if (MACD() > Ref(MACD(), -1) AddColumn( 32, "alert", formatChar, colorDefault, IIf(Filter && alert,colorPaleGreen,colorDefault) ); else if (MACD() > Signal()) AddColumn( 32, "check 1hr. & buy", formatChar, colorDefault, IIf(Filter && Buy,colorGreen,colorDefault) ); else if (MACD() > 0) AddColumn( 32, "confirm", formatChar, colorDefault, IIf(Filter && confirm,colorDarkGreen,colorDefault) ); else if (MACD() < Ref(MACD(), -1) AddColumn( 32, "alert", formatChar, colorDefault, IIf(Filter && alert,colorLightOrange,colorDefault) ); else if (MACD() < Signal()) AddColumn( 32, "check 1 hr & sell", formatChar, colorDefault, IIf(Filter && Sell,colorDarkRed,colorDefault) ); else if (MACD() < 0); AddColumn( 32, "confirm", formatChar, colorDefault, IIf(Filter && confirm,colorDarkRed,colorDefault) ); //end
