hi,
I don’t know why this fontion (same code) work for me only in Demo account ? :
myMACD = MACD[12,26,9](close)
long = myMACD crosses over 0
if(MACD>0) THEN
signals = 1
ELSE
signals = -1
ENDIF
IF long THEN
BUY 1 LOT AT close+10 LIMIT
ENDIF
SET STOP %TRAILING 0.5
GRAPH signals coloured(255,0,0) AS "MACD signals"
there is below a screen shot of my real account with an error
It's not GRAPH that is the problem, the code is correct. I'm thinking of a copy/paste that introduced an invisible character and bugged the interpreter. Try with a new code and retype everything by hand to see 🙂
You have put your backtest code in the indicator code editor, not the probacktest/proorder editor (hint 1: the editor doesn’t like the word “buy” just like the indicator editor would not like it; and hint 2: error window title is “erreur dans la programmation de l’indicateur”, while probacktest error window title would just be “erreur”)
PS: it’s a double post but we’ll leave it here… it would have been better to wait for an answer in the topic where the question was already asked, thank you
Thank you very much 🙂, I’m going to test this later today
PS : The purpose of this new topic about Graph fonction is not to pollute the other topic here which talks exclusively about Forex strategy 😉