probleme avec le declenchement de la strategie sur IG

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #257822 quote
    gregouech
    Participant
    Junior

    Hello

    J’ai fait un code assez simple qui shorte le retournement d’une bougie en Hekin Ashi.

    Ca marche comme il faut en backtest mais ca ne se declenche pas en automatique sur IG.

    J’ai ce probleme qque soit l’instrument (NG, XAU, SP, CC ….) et d’autres strategies s’enclenchent normalement donc ce n’est pas un probleme de compte a prioi.

    Bref, i am at a loss, merci pour toute suggestion

    codeHA.itf
    #257849 quote
    robertogozzi
    Moderator
    Master

    Essayez cette version légèrement modifiée :

    //-------------------------------------------------------------------------
    // Main code : short Hekin Ashi XAU
    //-------------------------------------------------------------------------
    defparam cumulateorders = false
    
    xClose = (Open+High+Low+Close)/4
    if(barindex>2) then
       xOpen= (xOpen[1] + xClose[1])/2
       xHigh= Max(high, xClose)
       xLow = Min(low, xclose)//xopen)
    endif
    
     
    red   = xclose[0] < xopen[0]
    white = xclose[0] > xopen[0]
    
    c0 = white[1] and white[2] and red[0]
    c1 = red[1]   and red[2]   and white[0]
    
    IF Not ONMarket THEN
       if c0 then
          sellshort 5 contract at market
       endif
    endif
    if onmarket and c1 then
       exitshort at market
    endif
    set stop   %loss   3
    set target %profit 3
    


    #257861 quote
    gregouech
    Participant
    Junior

    Hey Roberto

    bien note, j;essaie ca. Je vous envoie le feedback, merci pour votre aide

    robertogozzi thanked this post
    #257863 quote
    gregouech
    Participant
    Junior

    hey Roberto, it solved the issue. Ca doit etre le onmarket pour les short ou les quantites de la seconde condition. Merci beaucoup !

    robertogozzi thanked this post
    #259132 quote
    Marco PRT
    Participant
    New

    Bonjour,


    je me permets deposter une demande car j’ai un souci aussi pour la mise en éxècution de mes ordres sur proorders.


    Je suis nouveau sur le tradinG. Je me suis inscrit avec un compte IG où j’ai 700€. J’ai fait des robots achat et short sur le US Tech 100, l’Or Cash, le Cuivre High Grade etle Japan 225. Je prends 0,5 contrat chaque ordre.


    Je me permets de mettre une copie de deux codes afin de savoir si cela vient de la. Je ne suis pas un initié, désole. Et merci pour l’aide.





    Achat sur US Tech 100 :


    //————————————————————————-

    // Code principal : HA Impuls BearBull NASDAQ

    //————————————————————————-

    //————————————————————————-

    // Code principal : Heiken Ashi Impulsion BearBull

    //————————————————————————-


    DEFPARAM cumulateorders=false

    // ============================

    // PARAMÈTRES

    // ============================


    // ===== PARAMETRES =====

    ONCE x = 76.0

    ONCE y = 35.0

    ONCE z = 181.0

    bars = 10

    tf = 1

    smooth = 3

    threshold = 20


    // ===== CALCUL VITESSE =====

    pip = pipsize

    speed = ((close – close[1]) / pip) / tf


    // ===== LISSAGE =====

    smoothSpeed = average[smooth](speed)


    // ===== CUMUL IMPULSION =====

    zoneSpeed = summation[bars](smoothSpeed)


    // ===== DETECTION ZONES =====

    bullZone = 0

    bearZone = 0


    IF zoneSpeed > threshold THEN

    bullZone = zoneSpeed

    ENDIF


    IF zoneSpeed < -threshold THEN

    bearZone = zoneSpeed

    ENDIF



    // ===============================

    // 1️⃣INDICATEURS MACD

    // ===============================

    MACDL = MACD[12,26,9]

    SignalMACD = MACDSignal[12,26,9]

    Hist = MACDL – SignalMACD



    // ============================

    // HEIKEN ASHI

    // ============================

    HAClose = (Open + High + Low + Close) / 4


    IF BarIndex = 0 THEN

    HAOpen = (Open + Close) / 2

    ELSE

    HAOpen = (HAOpen[1] + HAClose[1]) / 2

    ENDIF


    GreenHA = HAclose > HAopen

    RedHA  = HAclose < HAopen


    // — Moyenne mobile simple —

    ema1 = Average[7](close)

    ema2 = Average[200](close)



    // — ADX FILTRE DE TENDANCE —

    ADXval = ADX[14]

    TrendOK = ADXval > 20


    // Conditions pour ouvrir une position acheteuse

    IF NOT LongOnMarket AND haopen<haclose and bearzone and zonespeed<=-35 and speed [5]> speed [1] and ema1>ema2 THEN

    BUY 1 CONTRACTS AT MARKET

    SET target profit 76

    SET STOP $LOSS 181

    ENDIF


    // Conditions pour fermer une position acheteuse

    If LongOnMarket AND bullzone and speed [5]<speed[1] THEN

    SELL AT MARKET

    ENDIF




    Short sur US Tech 100 :


    //————————————————————————-

    // Code principal : SH Ema Impuls Nasd 1m

    //————————————————————————-

    //————————————————————————-

    // Code principal : Heiken Ashi EMA MACD ADX TPSL

    //————————————————————————-

    // ============================

    // PARAMÈTRES

    // ============================


    // ===== PARAMETRES =====

    ONCE x = 31.0

    ONCE y = 211.0

    ONCE z = 30.0

    bars = 10

    tf = 1

    smooth = 3

    threshold = 20


    // ===== CALCUL VITESSE =====

    pip = pipsize

    speed = ((close – close[1]) / pip) / tf


    // ===== LISSAGE =====

    smoothSpeed = average[smooth](speed)


    // ===== CUMUL IMPULSION =====

    zoneSpeed = summation[bars](smoothSpeed)


    // ===== DETECTION ZONES =====

    bullZone = 0

    bearZone = 0


    IF zoneSpeed > threshold THEN

    bullZone = zoneSpeed

    ENDIF


    IF zoneSpeed < -threshold THEN

    bearZone = zoneSpeed

    ENDIF



    // ===============================

    // 1️⃣INDICATEURS MACD

    // ===============================

    MACDL = MACD[12,26,9]

    SignalMACD = MACDSignal[12,26,9]

    Hist = MACDL – SignalMACD



    // ============================

    // HEIKEN ASHI

    // ============================

    HAClose = (Open + High + Low + Close) / 4


    IF BarIndex = 0 THEN

    HAOpen = (Open + Close) / 2

    ELSE

    HAOpen = (HAOpen[1] + HAClose[1]) / 2

    ENDIF


    GreenHA = HAclose > HAopen

    RedHA  = HAclose < HAopen


    // — Moyenne mobile simple —

    ema1 = Average[1](close)

    ema2 = Average[50](close)

    ema3 = Average[200](close)


    // — ADX FILTRE DE TENDANCE —

    ADXval = ADX[14]

    TrendOK = ADXval > 20


    // ===============================

    // 3️⃣CONDITIONS D’NTRÉ

    // ===============================

    CrossUpMACD = (SignalMACD[1] > MACDL[1]) AND (MACDL[2] > SignalMACD[2])

    EntryLong  = ema1<ema2 and bullzone and speed[1]-speed[2]>z



    // ===============================

    // 4️⃣CONDITIONS DE SORTIE

    // ===============================

    CrossDownMACD = (MACDL[1] > SignalMACD[1]) AND (MACDL [2] < SignalMACD [2])

    ExitCond1   = (MACDL[1] < MACDL[2])

    ExitLong   = ema1 crosses over ema3

    // ============================

    // LOGIQUE DE TRADING

    // ============================


    // Entrée : bougie HA verte

    IF Entrylong and NOT OnMarket THEN

    SELLSHORT 1 CONTRACT AT MARKET

    // ATTENTION : valeurs numéiques directes

    set target profit x

    SET STOP LOSS y   // 20 pips

    ENDIF


    // Sortie : à la bougie suivante

    IF OnMarket AND Exitlong THEN

    EXITSHORT AT MARKET

    ENDIF



    En vous remerciant de votre réponse,


    Marc

    #259134 quote
    Nicolas
    Keymaster
    Master

    Marco, merci de ne pas poster à la suite d’autres sujets. Pour chaque demande, il est préférable de créer un nouveau sujet, j’ai déjà déplacé ton premier message ici :

    ProOrder IG : ordres non déclenchés sur US Tech 100


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

probleme avec le declenchement de la strategie sur IG


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
gregouech @gregouech Participant
Summary

This topic contains 5 replies,
has 4 voices, and was last updated by Nicolas
4 weeks ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 02/11/2026
Status: Active
Attachments: 1 files
Logo Logo
Loading...