trade avec SUPERTREND 3.10

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #164491 quote
    Roland57800Roland57800
    Participant
    Veteran

    Bonjour,

    je travaille sur un code dans lequel je voudrais que le trade (Achat ) soit clôturé

    si la close passe sous SUPERTREND 3.10

    J’ai un souci car ça ne fonctionne pas et je ne trouve pas la solution pour remédier au problème

    DEFPARAM CumulateOrders = false                    // FALSE or TRUE
    DEFPARAM Preloadbars = 3000
    DEFPARAM flatafter = 214500
    
    
    
    
    // TAILLE DES POSITIONS
    
    level = 1
    
    // TARGET ET STOP
    tp = 33
    //sl = 80
    
    RSI14 = rsi[14]
    
    ST = supertrend [3,10]
    
    A1 = close > ST
    A2 = RSI14 >= 50 and RSI14 <= 64.5
    
    
    // HORAIRES DE TRADING
    TimeAchat = time >= 080500 and time < 190000
    //TimeVente = time >= 080500 and time < 190000
    
    // CONDITION POUR ACHAT
    
    
    IF not longonmarket and A1 and A2 and TimeAchat then
    BUY level shares at market
    SET TARGET pPROFIT tp
    //SET STOP pLOSS sl
    If close crosses under ST then
    sell level shares at market
    ENDIF
    
    endif
    
    // CLOTURE DÉFINITIVE DE TOUS LES TRADES -- 19 Heures --
    IF Longonmarket and  time >= 215500 THEN
    SELL AT MARKET
    ENDIF

     

    d’où vient le problème.

    Merci pour une aide sur le sujet

    Cordialement

    #164492 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    Bonjour,

    tu as mis ton bloc “if endif” de vente du passage sous supertrend en lignes 35-37 à l’intérieur du bloc “if endif” d’achat des lignes 31-39, ce qui fait que ce n’est lu qu’une fois, en même temps que la décision d’achat, mais pas les bougies d’après. Il faut le mettre à part, comme le bloc des lignes 42-44

    #164495 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    (dit autrement, essaye en déplaçant un endif ainsi:)

    IF not longonmarket and A1 and A2 and TimeAchat then
    BUY level shares at market
    endif
    
    SET TARGET pPROFIT tp
    //SET STOP pLOSS sl
    If close crosses under ST then
    sell level shares at market
    ENDIF
    
    #164497 quote
    Roland57800Roland57800
    Participant
    Veteran

    Merci Noobywan,

    je vais corriger et tester ça

     

    Bon après-midi

    Cordialement

Viewing 4 posts - 1 through 4 (of 4 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

trade avec SUPERTREND 3.10


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Roland57800Roland57800
5 years, 8 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 03/17/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...