hi,
i want to go long when a bull candle is over the 20ma. the codes i got for it is
ma20 = Average[20](close) //set ma20 as the 20 simple moving average
bullcandle = (close > open) //bull candle
c1 = (open >= ma20) AND bullcandle
IF c1 then
BUY 1 CONTRACT AT MARKET
ENDIF
some candles done on the backtest satisfy what i was coding it for but some do not. like the one on the picture. can anyone explain what i am doing wrong and how can i improve thanks.
There’s no pic attached ti your post.
At first glance your code seems correct.
kevin12345 – Please try to give your topics more meaningful titles. I have changed the title of your topic to something more descriptive.
how do i submit a picture? isnt it select file under attachment?
It’s working fine on Dax, 15-minute TF.
Post instrument/asset, TF, date and time where there’s a wrong entry, so I can replicate it.
it seems like its working now when i checked again. i don’t know what happen but thank you for reply.