Keros a écrit : 17 nov. 2020, 12:51
Bonjour Charles et bienvenue sur le forum
Je traduit la ligne en question : Si cs1 et cs2 et cs3 alors short=1 sinon short=0 fin
Il manque en effet quelque chose.
Maintenant sans l'ensemble de ton code, il est difficile de aiguiller sur la syntaxe que tu cherches.
Pour info, il y a des balises code (avec le bouton </>) qui permettent de séparer le code de ton message : ça facilite la lecture.
Il y a beaucoup de code sur le forum tu devrais trouver des exemples.
J'ai écris quelques lignes à propos de la programmation dans ma signature. Ça peut t'aider à démarrer
merci de ta réponse
voici l ensemble du code et le messsage d erreur est [string "code"]:20: syntax error near 'if'
myMA50=exponentialaverage[50](close)
myMA100=exponentialaverage[100](close)
ATR=averagetruerange[14](close)
cs1= myMA7[1]<myMA7[2]
c1=myMA7[1]>myMA7[2]
timing= time>=080000 and time<220000
c2=high>high[1]+2.5 and close>myMA7 and close>open
cs2=low<low[1]-2.5 and close<myMA7 and close<open
c3=abs(high[1]-myMA50[1])>ATR or abs(high[1]-myMA100[1])>ATR
cs3=abs(low[1]-myMA50[1])>ATR or abs(low[1]-myMA100)>ATR
if c1 and c2 and c3 then
long=1
else
long=0
endif
if cs1 and cs2 and cs3 then
short=1
else
short=0
endif
//test=c3
//drawtext("#test#",barindex,lowest[3](low)-ATR0.5pipsize,SansSerif,Bold,10) COLOURED(0,155,10)
if long=1 and long[1]=0 and timing then
ENTREE=high[1]+2.5
//ENTREEmod=ENTREE mod 1000
DRAWARROWUP(barindex,low) COLOURED(0,155,10)
//drawtext("Break=#ENTREEmod#",barindex,lowest[3](low)-ATR0.5pipsize,SansSerif,Bold,10) COLOURED(0,155,10)
drawtext("---",barindex,ENTREE,SansSerif,Bold,20) coloured (0,155,10)
endif
if short=1 and short[1]=0 and timing then
ENTREE=low[1]-2.5
//ENTREEmod=ENTREE mod 1000
DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
//drawtext("Break=#ENTREEmod#",barindex,highest[3](high)+ATR0.5pipsize,SansSerif,Bold,10) COLOURED(255,0,10)
drawtext("---",barindex,ENTREE,SansSerif,Bold,20) coloured (255,0,0)
endif
return