Support et résistance avec Ichimoku

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #148704 quote
    Fantasio2020
    Participant
    Senior

    je vais tester…!

    #148708 quote
    Fantasio2020
    Participant
    Senior

    la modification ne change rien…. 🙁

    #148711 quote
    Fantasio2020
    Participant
    Senior

    ci-dessous l’erreur remontée

    Erreur.png Erreur.png
    #148716 quote
    Fantasio2020
    Participant
    Senior
    // Définition des paramètres du code
    Defparam CumulateOrders = False
    Defparam Preloadbars = 30000
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    Distance = 15
    LookBack = 15000
    SR = 9
    
    // Timeframe SRLevel
    timeframe (30 minutes, updateonclose)
    // --- icihmoku support and resistance
    kijun = (highest[26](high)+lowest[26](low))/2
    SSB = (highest[52](high[26])+lowest[52](low[26]))/2
     
    kijunp = summation[SR](Kijun=Kijun[1])=SR
    ssbp = summation[SR](SSB=SSB[1])=SR
     
    if kijunp then
    kijunPrice = kijun
    endif
    if ssbp then
    ssbPrice = SSB
    endif
    if kijunprice = ssbprice then
    SRlevel = kijunprice
    endif
    
    //Timeframe en UT de Trading
    Timeframe (10 seconds, default)
    
    //************************************************************************
    levier = 2
    capital = 500 + (strategyprofit*2/5)
    z = (capital / (close/20)) * levier
    //************************************************************************
    //Position acheteuse
    buycondition = rsi[14] crosses over 50
    buycondition2 = x Crosses Over 0.7 and Summation[2](x > 0.5) = 2
    if Buycondition and not onmarket and not daysForbiddenEntry then
    allowtrading = 1
    for iSRB = 0 to lookback -1 do
    dist = abs(close-SRlevel[iSRB]) < distance*pipsize
    if dist then
    allowtrading = 0 //no trading is allowed we are near a SR!
    break //break the loop, no need to continue, trading is not allowed anymore!
    endif
    next
    If BuyCondition2 then
    Entry = Barindex
    endif
    if Barindex-Entry <= 2 then
    if allowtrading then
    buy z share at market
    endif
    endif
    endif
    
    //Position Vendeuse
    sellcondition = rsi[14] crosses under 50
    sellcondition2 = x Crosses Over 0.7 and Summation[2](x > 0.5) = 2
    if SellCondition and not onmarket and not daysForbiddenEntry then
    allowtrading = 1
    for iSRV = 0 to lookback -1 do
    dist = abs(close-SRlevel[iSRV]) < distance*pipsize
    if dist then
    allowtrading = 0 //no trading is allowed we are near a SR!
    break //break the loop, no need to continue, trading is not allowed anymore!
    endif
    next
    if SellCondition2 then
    Entry = Barindex
    endif
    If Barindex-Entry <= 2 then
    if allowtrading then
    sellshort z share at market
    endif
    endif
    endif
    
    //************************************************************************
    //Stop Loss & Trailing function
    Set stop $loss capital*levier*4/100
    Set Target $Profit capital*levier*5/100

    Ci-dessus, la partie du code qui semble poser problème.

    je me demande si ce n’est pas un problème de preloadbars entre  les deux timeframe…

    #148751 quote
    Nicolas
    Keymaster
    Master

    Un lookback de 15.000 bars est énorme ! Une boucle sur 15000 chandeliers c’est beaucoup trop, même si celle-ci n’ira jamais jusqu’au  bout, puisqu’on trouvera un support ou une résistance avant d’arriver au terme de celle-ci.

    Bref, le problème principale dans ton cas, c’est surtout que ProOrder ne peut pas charger plus de 10.000 unités d’historique, donc ta boucle ne peut pas dépasser cette valeur !

    #148753 quote
    Fantasio2020
    Participant
    Senior

    Je vais faire quelques tests… Je te revient lorsque j’ai réglé le soucis…. Je vais baisser la valeur à 10.000 dans un premier temps….

     

    Merci du retour

    #148779 quote
    Fantasio2020
    Participant
    Senior

    Bjr Nicolas,

    Problème réglé!

    baisser LookBack à 9999 à réglé les arrêts.

    Merci pour le retour.

    #149090 quote
    Fantasio2020
    Participant
    Senior
    Defparam CumulateOrders = False
    Defparam Preloadbars = 43200
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    Distance = 8
    LookBack = 5000
    SRk = 5
    SRs = 8
    
    // --- icihmoku support and resistance
    kijun = (highest[26](high)+lowest[26](low))/2
    SSB = (highest[52](high[26])+lowest[52](low[26]))/2
     
    kijunp = summation[SRk](Kijun=Kijun[1])=SRk
    ssbp = summation[SRs](SSB=SSB[1])=SRs
     
    if kijunp then
    kijunPrice = kijun
    endif
    if ssbp then
    ssbPrice = SSB
    endif
    if kijunprice = ssbprice then
    SRlevel = kijunprice
    if SRLevel > Close then
    ResLevel = SRlevel
    elsif SRLevel < Close then
    SupLevel = SRlevel
    endif
    endif
    
    //************************************************************************
    levier = 2
    capital = 500 + (strategyprofit*2/5)
    z = (capital / (close/20)) * levier
    //************************************************************************
    
    //Buy Conditions
    buycondition = rsi[14] crosses over 50
    buycondition2 = x Crosses Over 0.7 and Summation[2](x > 0.5) = 2
    if Buycondition and not onmarket and not daysForbiddenEntry then
    allowtrading = 1
    for iSRB = 0 to lookback -1 do
    dist = (Reslevel[iSRB] - Close) < distance*pipsize
    if dist then
    allowtrading = 0 //no trading is allowed we are near a SR!
    break //break the loop, no need to continue, trading is not allowed anymore!
    endif
    next
    If BuyConditionL then
    Entry = Barindex
    endif
    if Barindex-Entry <= 2 then
    if allowtrading then
    buy z share at market
    endif
    endif
    endif
    
    
    //Sell Conditions
    sellcondition = rsi[14] crosses over 50
    sellcondition2 = x Crosses Over 0.7 and Summation[2](x > 0.5) = 2
    if sellcondition and not onmarket and not daysForbiddenEntry then
    allowtrading = 1
    for iSRV = 0 to lookback -1 do
    dist = (close-Suplevel[iSRV]) < distance*pipsize
    if dist then
    allowtrading = 0 //no trading is allowed we are near a SR!
    break //break the loop, no need to continue, trading is not allowed anymore!
    endif
    next
    if SellCondition2 then
    Entry = Barindex
    endif
    If Barindex-Entry <= 2 then
    if allowtrading then
    sellshort z share at market
    endif
    endif
    endif
    
    //************************************************************************
    //Stop Loss & Trailing function
    Set stop $loss capital*levier*4/100
    Set Target $Profit capital*levier*5/100
    

    Quelques corrections sur le code.

    De cette manière les Supports et Résistances sont clairement identifiés.

    #149092 quote
    Fantasio2020
    Participant
    Senior

    Dans le même registre, est ce qu’il est possible de créer une boucle sur les mêmes conditions de distance, avec les supports et résistances du pivot (pivot compris)

    Pivot = (Dhigh(1) + Dlow(1) + Dclose(1) + Dopen(0))/4  //Pivot
    Res3 = Dhigh(1)+(2*(Pivot-Dlow(1)))        //Res3
    Res2 = Pivot+(Dhigh(1)-Dlow(1))            //Res2
    Res1 = (2*Pivot) - Dlow(1)                 //Res1
    Sup1 = (2*Pivot) - Dhigh(1)                //Sup1
    Sup2 = Pivot-(Dhigh(1)-Dlow(1))            //Sup2
    Sup3 = Dlow(1)-(2*(Dhigh(1)-Pivot))        //Sup3

    Merci pour l’aide.

    #149112 quote
    Fantasio2020
    Participant
    Senior

    J’ai géré comme ci-dessous:

    //Pivot (H + L + C + O)/4
    If OpenDayOfWeek = 1 Then
    Ht = DHigh(2)
    Bs = DLow(2)
    C = DClose(2)
    O = DOpen(0)
    Endif
    If OpenDayOfWeek => 2 and dayofweek < 6 Then
    Ht = DHigh(1)
    Bs = DLow(1)
    C = DClose(1)
    O = DOpen(0)
    Endif
    
    Pivot = (Ht + Bs + C + O)/4
    Res4 = Ht + (3*(Pivot - BS))
    Res3 = Ht + (2*(Pivot - Bs))
    Res2 = Pivot + (Ht - Bs)
    Res1 = (2*Pivot) - Bs
    Sup1 = (2*Pivot) - Ht
    Sup2 = Pivot-(Ht - Bs)
    Sup3 = Bs - (2*(Ht - Pivot))
    Sup4 = Bs - (3*(Ht - Pivot))
    
    // Position acheteuse
    if close > pivot then
    //above Pivot
    iPivt = 1
    while iPivt =< 4 do
    if iPivt = 1 then
    Floor = Pivot
    Ceil = Res1
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 2 then
    Floor = Res1
    Ceil = Res2
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 3 then
    Floor = Res2
    Ceil = Res3
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 4 then
    Floor = Res3
    Ceil = Res4
    if close > Floor and close < Ceil then
    break
    endif
    endif
    iPivt = iPivt + 1
    wend
    elsif close < Pivot then
    //below Pivot
    iPivt = 1
    while iPivt <= 4 do
    if iPivt = 1 then
    Floor = Sup1
    Ceil = Pivot
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 2 then
    Floor = Sup2
    Ceil = Sup1
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 3 then
    Floor = Sup3
    Ceil = Sup2
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 4 then
    Floor = Sup4
    Ceil = Sup3
    if close > Floor and close < Ceil then
    break
    endif
    endif
    iPivt = iPivt + 1
    wend
    endif
    For IPivt = 1 to 4 do
    dist = (Ceil - Close) < distance*pipsize
    If Dist then
    allowtrading = 0
    Break
    endif
    next
    
    // Position vendeuse
    if close > pivot then
    //above Pivot
    iPivt = 1
    while iPivt =< 4 do
    if iPivt = 1 then
    Floor = Pivot
    Ceil = Res1
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 2 then
    Floor = Res1
    Ceil = Res2
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 3 then
    Floor = Res2
    Ceil = Res3
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 4 then
    Floor = Res3
    Ceil = Res4
    if close > Floor and close < Ceil then
    break
    endif
    endif
    iPivt = iPivt + 1
    wend
    elsif close < Pivot then
    //below Pivot
    iPivt = 1
    while iPivt <= 4 do
    if iPivt = 1 then
    Floor = Sup1
    Ceil = Pivot
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 2 then
    Floor = Sup2
    Ceil = Sup1
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 3 then
    Floor = Sup3
    Ceil = Sup2
    if close > Floor and close < Ceil then
    break
    endif
    elsif iPivt = 4 then
    Floor = Sup4
    Ceil = Sup3
    if close > Floor and close < Ceil then
    break
    endif
    endif
    iPivt = iPivt + 1
    wend
    endif
    For IPivt = 1 to 4 do
    dist = (Close - Floor) < distance*pipsize
    If Dist then
    allowtrading = 0
    Break
    endif
    next
    

    ça a l’air de fonctionner, mais j’ai l’impression que c’est interminable…!

    y a t’il moyen de simplifier?

    #149294 quote
    Fantasio2020
    Participant
    Senior

    Très bien, j’ai créé une stratégie toute simple qui prendra ses ordres si “allowtrading” est égal à 1 (égal à 0 si trop proche d’un SR).

    Dans la boucle on teste une proximité de “distance” avec un support/resistance détecté dans les “lookback” derniers chandeliers.

    Bjr Nicolas,

    j’ai ajusté un peu les plats Kijun et SSB:

    SRk = 5
    SRs = 8
     
    // --- icihmoku support and resistance
    kijun = (highest[26](high)+lowest[26](low))/2
    SSB = (highest[52](high[26])+lowest[52](low[26]))/2
     
    kijunp = summation[SRk](Kijun=Kijun[1])=SRk
    ssbp = summation[SRs](SSB=SSB[1])=SRs
     
    if kijunp then
    kijunPrice = kijun
    endif
    if ssbp then
    ssbPrice = SSB
    endif
    if kijunprice = ssbprice then
    SRlevel = kijunprice
    if SRLevel > Close then
    ResLevel = SRlevel
    elsif SRLevel < Close then
    SupLevel = SRlevel
    endif
    endif

    Néanmoins codé tel quel, j’ai l’impression que ça ne trace les SRlevel que lorsque kijunP et SSBp sont strictement = à SRk et SRs.

    je n’arrive pas à codé une alternative ou il faut Min SRk pour Kijunp et Min SRs pour SSBp.

    une idée?

Viewing 11 posts - 16 through 26 (of 26 total)
  • You must be logged in to reply to this topic.

Support et résistance avec Ichimoku


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
Summary

This topic contains 25 replies,
has 2 voices, and was last updated by Fantasio2020
5 years, 4 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 10/25/2020
Status: Active
Attachments: 5 files
Logo Logo
Loading...