Erreur de ¨PRT avec Buy/Sell sur indicateur
Forums › ProRealTime forum Français › Support ProBuilder › Erreur de ¨PRT avec Buy/Sell sur indicateur
- This topic has 4 replies, 2 voices, and was last updated 2 years ago by
JC_Bywan.
-
-
03/10/2023 at 9:12 PM #211335
Bonjour,
j’ai écrit un petit programme de cassure assez simple mais PRT me le refuse :
Erreur dans l’indicateur “! BO1430” : les ordres BUY/STOP ne sont autorisés que dans le cadre
des systèmes de trading
Mais il n’y a aucun ordre dans cet indicateur.
Si quelqu’un peut m’aider ?
Voici le programme:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293//parameters :boxsize=0.4debut=143000//------------------------ Etablissement du renko ----------------//repris de Nicloasonce topprice = highonce bottomprice = low - boxsize*ticksizeif(high > topprice + boxsize) THENtopprice = highbottomprice = topprice - boxsizeELSIF (low < bottomprice - boxsize) THENbottomprice = lowtopprice = bottomprice + boxsizeELSEtopprice = toppricebottomprice = bottompriceENDIF//------------------- Canal d'ouverture -------------------once pH=highonce PB=lowonce CA1=highonce CA2=highonce CA3=highonce CV1=lowonce CV2=lowonce CV3=lowonce SSA1=highonce SSA2=highonce SSV1=lowonce SSV2=lowif time<debut thencpt=0PH=toppricePB=bottompriceSSA1=toppriceSSA2=toppriceSSV1=bottompriceSSV2=bottompriceelsif topprice<>topprice[1] thencpt=cpt+1PH=max(PH,topprice)PB=min(PB,bottomprice)if high> CA3 thenSSA1=max(SSA1,high-2*ecart)endifif high[1]<=CA3 and high>=CA3 thenetat=3endifif etat=3 and high[1]>=CA and high<CA1 thenSSA2=max(tradeprice,high-2*ecart)endifif low<CV3 thenSSV1=min(SSV1,low+2*ecart)endifif low[1]>=CV3 and low<=CV3 thenetat=-3endifif etat=-3 thenSSV2=min(tradeprice,low+2*ecart)endifendifif cpt>5 thenPH=PH[1]PB=PB[1]endifecart=PH-PBCA1=PH+1*ecartCA2=PH+2*ecartCA3=pH+3*ecartCV1=PB-1*ecartCV2=PB-2*ecartCV3=PB-3*ecartif cpt>0 and cpt<6and cpt[1]<>cpt thendrawtext("#cpt#",barindex+3,PH+.5,dialog,bold,12)coloured(0,0,0)endifif cpt=0 thenCA1=highCA2=highCA3=highCV1=lowCV2=lowCV3=lowendifRETURN topprice style(line,1)coloured(0,0,0) as "topbox", bottomprice style(line,1)coloured(0,0,0) as "bottombox",PH style(line,2)coloured(0,0,0) as "PH",PB style(line,2)coloured(0,0,0) as "PB",CA1 style(dottedline,2)coloured(0,90,0)as"CA1",CA2 style(dottedline,2)coloured(0,90,0)as"CA2",CA3 style(dottedline,2)coloured(0,90,0)as"CA3",CV1 style(dottedline,2)coloured(210,0,0)as"CV1",CV2 style(dottedline,2)coloured(210,0,0)as"CV2",CV3 style(dottedline,2)coloured(210,0,0)as"CV3",SSA1 style(line,1)coloured(255,0,0) as "stopSA1",SSV1 style(line,1)coloured(255,0,255)as"stopSV1",SSA2 style(dottedline,1)coloured(255,0,255) as"stopSA2",SSV2 style(dottedline,1)coloured(255,0,255) as "stopSV2"03/10/2023 at 10:09 PM #211339Bonsoir,
J’ai reformaté le code, on y voit l’usage du mot-clé tradeprice (lignes 56,65), qui dans probacktest/proorder récupère le niveau d’éxécution d’un ordre (d’où le message générique même si les mots buy ou sell ne sont pas dans le code). Tradeprice ne passe pas dans un code d’indicateur.
03/11/2023 at 11:25 AM #21136103/11/2023 at 12:10 PM #21136503/12/2023 at 3:06 PM #211418Ok, vu, lien en cas de futur lecteur tombant sur ce post via case “recherche” quand les 2 sujets ne seront plus en 1ère page: https://www.prorealcode.com/topic/sortie-de-tposition-refusee-sur-niveau/
-
AuthorPosts
Find exclusive trading pro-tools on