Erreur de ¨PRT avec Buy/Sell sur indicateur

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #211335 quote
    Lurubu
    Participant
    Senior

    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:

     

    //parameters :
    boxsize=0.4
    debut=143000
    
    //------------------------ Etablissement du renko ----------------
    
    //repris de Nicloas
    
    once topprice = high
    once bottomprice = low - boxsize*ticksize
    
    if(high > topprice + boxsize) THEN
    topprice = high
    bottomprice = topprice - boxsize
    ELSIF (low < bottomprice - boxsize) THEN
    bottomprice = low
    topprice = bottomprice + boxsize
    ELSE
    topprice = topprice
    bottomprice = bottomprice
    ENDIF
    
    //------------------- Canal d'ouverture -------------------
    once pH=high
    once PB=low
    once CA1=high
    once CA2=high
    once CA3=high
    once CV1=low
    once CV2=low
    once CV3=low
    once SSA1=high
    once SSA2=high
    once SSV1=low
    once SSV2=low
    
    if time<debut then
    cpt=0
    PH=topprice
    PB=bottomprice
    SSA1=topprice
    SSA2=topprice
    SSV1=bottomprice
    SSV2=bottomprice
    elsif topprice<>topprice[1] then
    cpt=cpt+1
    PH=max(PH,topprice)
    PB=min(PB,bottomprice)
    if high> CA3 then
    SSA1=max(SSA1,high-2*ecart)
    endif
    if high[1]<=CA3 and high>=CA3 then
    etat=3
    endif
    if etat=3 and high[1]>=CA and high<CA1 then
    SSA2=max(tradeprice,high-2*ecart)
    endif
    if low<CV3 then
    SSV1=min(SSV1,low+2*ecart)
    endif
    if low[1]>=CV3 and low<=CV3 then
    etat=-3
    endif
    if etat=-3 then
    SSV2=min(tradeprice,low+2*ecart)
    endif
    endif
    if cpt>5 then
    PH=PH[1]
    PB=PB[1]
    endif
    ecart=PH-PB
    CA1=PH+1*ecart
    CA2=PH+2*ecart
    CA3=pH+3*ecart
    CV1=PB-1*ecart
    CV2=PB-2*ecart
    CV3=PB-3*ecart
    
    if cpt>0 and cpt<6and cpt[1]<>cpt then
    drawtext("#cpt#",barindex+3,PH+.5,dialog,bold,12)coloured(0,0,0)
    endif
    
    if cpt=0 then
    CA1=high
    CA2=high
    CA3=high
    CV1=low
    CV2=low
    CV3=low
    endif
    
    RETURN 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"
    #211339 quote
    JC_Bywan
    Moderator
    Master

    Bonsoir,

    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.

    #211361 quote
    Lurubu
    Participant
    Senior

    Grand merci pour la réponse rapide et claire.

    Bonne journée

    #211365 quote
    Lurubu
    Participant
    Senior

    Je vais abuser de ton expertise. Je viens de poster un problème dans support ProOrder?

    “Sortie refusée…..”

    Mais ne te sent pas obligé et passe quand un bon week-end.

    Cordialement

    #211418 quote
    JC_Bywan
    Moderator
    Master

    Ok, 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/

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Erreur de ¨PRT avec Buy/Sell sur indicateur


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Lurubu @lurubu Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by JC_Bywan
3 years ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 03/10/2023
Status: Active
Attachments: No files
Logo Logo
Loading...