Condition AND non satisfaite

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #189874 quote
    Nico7
    Participant
    New

    Bonjour,

    Soit ce code simple pour enter en position si une bougie croise la tenkan ET la kijun à la baisse

    tenkan = TenkanSen[9,26,52]
    kijun = KijunSen[9,26,52]
    
    c1 = (close CROSSES UNDER kijun)
    c2 = (close CROSSES UNDER tenkan)
    
    IF c1 and c2 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Stops et objectifs
    SET STOP pLOSS 30
    SET TARGET pPROFIT 100
    

    La bougie entourée en bleu satisfait les deux condition cependant le trade n’est pas déclenché

    Ce qui est étrange c’est que si je ne spécifie qu’une seule des deux condition dans le IF, ça fonctionne, par exemple:

    tenkan = TenkanSen[9,26,52]
    kijun = KijunSen[9,26,52]
    
    c1 = (close CROSSES UNDER kijun)
    c2 = (close CROSSES UNDER tenkan)
    
    IF c1 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Stops et objectifs
    SET STOP pLOSS 30
    SET TARGET pPROFIT 100
    

    Ou bien

    tenkan = TenkanSen[9,26,52]
    kijun = KijunSen[9,26,52]
    
    c1 = (close CROSSES UNDER kijun)
    c2 = (close CROSSES UNDER tenkan)
    
    IF c2 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Stops et objectifs
    SET STOP pLOSS 30
    SET TARGET pPROFIT 100
    

    Quelqu’un sait pourquoi ?

    Merci

    #189876 quote
    Nico7
    Participant
    New

    Désolé j’ai compris mon erreur mais je n’arrive pas à supprimer le topic

    Il faut plutôt faire:

    tenkan = TenkanSen[9,26,52]
    kijun = KijunSen[9,26,52]
    
    c1 = (close < kijun)
    c2 = (close < tenkan)
    c3 = (open > kijun)
    c4 = (open > tenkan)
    
    
    IF c1 and c2 and c3 and c4 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Stops et objectifs
    SET STOP pLOSS 30
    SET TARGET pPROFIT 100
    
    GraHal thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Condition AND non satisfaite


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Nico7 @nico7 Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by Nico7
3 years, 12 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 03/12/2022
Status: Active
Attachments: No files
Logo Logo
Loading...