Erreur de BackTest avec Tableau dans une condition

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #225441 quote
    Pierreco1991Pierreco1991
    Participant
    Junior

    Bonjour

    J’obtiens cette erreur sur mon code . Après Analyse de ma part (donc peut être pas complète), je me suis aperçu que la causé était du à l’utilisation d’un tableau dans une condition

    IF close CROSSES UNDER $PriceTP[TPpartiel] THEN
    EXITSHORT (myPosLeveL*$ExitPos[TPpartiel]) CONTRACTS AT MARKET
    
    // mise à BE sur le level souhaité
    if TPpartiel = 0 THEN
    set stop breakeven
    ENDIF
    TPpartiel = TPpartiel +1
    ENDIF
    

    En mettant une variable tampon, cela resout  le problème

    tmpBug = $PriceTP[TPpartiel]
    GRAPH ($PriceTP[TPpartiel])
    IF close CROSSES UNDER tmpBug THEN
    EXITSHORT (myPosLeveL*$ExitPos[TPpartiel]) CONTRACTS AT MARKET
    
    // mise à BE sur le level souhaité
    if TPpartiel = 0 THEN
    set stop breakeven
    ENDIF
    TPpartiel = TPpartiel +1
    ENDIF
    

    Est ce un bug ou une mauvaise utilisation des tableaux ?

    Merci

    Capture-2.png Capture-2.png
    #225502 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Il ne s’agit pas d’une erreur de plateforme.
    Les tableaux ne sont pas historisés, vous ne pouvez donc pas utiliser CROSSES OVER ou COSSES UNDER, car cela implique de connaître la valeur précédente.

    La seule solution est exactement ce que vous avez fait, c’est-à-dire utiliser une variable tampon, car avec tmpBug, le système peut connaître la valeur de la bougie précédente et déterminer s’il y a eu un croisement ou non.

    Pierreco1991 thanked this post
    #225507 quote
    Pierreco1991Pierreco1991
    Participant
    Junior

    Bonjour

    Merci pour le retour et l’explication.

    Bonne journée

    robertogozzi thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Erreur de BackTest avec Tableau dans une condition


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Pierreco1991Pierreco1991
2 years, 11 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 12/19/2023
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...