I would like to ask you guys for advice.
I coded a simple strategy.I was using MA function but now I need to change the old MA function for EMA function. But I get an error. The error occurs here "EMA(C,WeeklyShortMA) > EMA(C,WeeklyLongMA)". I could just write in a number instead of WeeklyShortMA but I need to have
weekly MA(25)>MA(50) for uptrend confirmation while working in a daily chart.
Original functional code:
TimeFrameSet(inWeekly); WeeklyShortMA = 25; WeeklyLongMA = 50; TimeFrameRestore(); WeeklyShortMA = TimeFrameExpand(WeeklyShortMA,inWeekly); WeeklyLongMA = TimeFrameExpand(WeeklyLongMA,inWeekly); ShortMA = 25; LongMA = 50; Buy = EMA(C,ShortMA) > EMA(C,LongMA) AND MA(C,WeeklyShortMA) > MA(C,WeeklyLongMA) AND RSI(2) < 10 AND Ref(RSI(2),-1) < 10; BuyPrice = Open; Sell = C > EMA(C,5); SellPrice = Open;