Valeur de Slope pour la prise de position

Viewing 15 posts - 31 through 45 (of 55 total)
  • Author
    Posts
  • #134186 quote
    Fantasio2020
    Participant
    Senior

    Mais lol….

    Je sais bien que ça fonctionne…

    par contre ce que je trouve pas correct, c’est que tu apprécies la partie du code que je poste sans arrières pensées… et que tu ne partage pas les améliorations que tu y apporte.

    Merci

    #134190 quote
    Fantasio2020
    Participant
    Senior

    Zigo,

     

    1
    
    P=21
    N=26
     
    EMA = EndPointAverage[P](Close)
     
    If EMA >= EMA[N] Then
    Slope = (EMA - EMA[N])/EMA[N]
    elsif EMA < EMA[N] Then
    Slope = (EMA - EMA[N])/EMA
    Endif
     
    if slope>0 then
    slope=+1
    elsif slope <0 then
    slope =-1
    endif
    res = sin(atan(slope+slope[1]+slope[2]))
    Fin = res-res[1]
     
    return res, fin

    Peux tu me donner un peu plus d’info sur RES et FIN???

    #134202 quote
    Zigo
    Participant
    Master

    Res = resultat

    Fin = finalement

    #134203 quote
    Fantasio2020
    Participant
    Senior

    Ok,

    dans ce cas tu les utilises comment:

    Comme condition?

    donne moi un peu plus d’infos stp….

    c’est à prendre comme condition?

    #134215 quote
    Nicolas
    Keymaster
    Master

    Zigo crée des conditions booléennes basés sur l’état de la slope ascendante ou descendante, puis il utilise sa fameuse formule trigonométrique 😉 pour organiser un signal autour de ces conditions sur les 3 dernière périodes (sorte de filtre) = Res

    enfin il crée une différence entre les 2 dernières “res” pour afficher un signal de changement = Fin

    Sinon, je dois intervenir dans quel code au final ? 🙂

    Zigo thanked this post
    #134221 quote
    Fantasio2020
    Participant
    Senior

    Slt Nicolas,

    En effet, ça m’intéresse de comprendre comment il fait exactement, que j’arrive à intégrer ça dans mon code….

    Il me manque des éléments pour y arriver par moi même…

    Les idées ne m’anque pas, mais…. Manque de connaissance pour y parvenir seul…

     

    Merci pour ton aide….

    #134235 quote
    Zigo
    Participant
    Master
    // Definitie van code parameters
    DEFPARAM CumulateOrders = False // Opstapelen posities gedeactiveerd
    DEFPARAM flatbefore = 093000
    DEFPARAM Flatafter = 210000
    P=21
    N=26
     
    EMA = EndPointAverage[P](Close)
     
    If EMA >= EMA[N] Then
    Slope = (EMA - EMA[N])/EMA[N]
    elsif EMA < EMA[N] Then
    Slope = (EMA - EMA[N])/EMA
    Endif
    
    if slope>0 then
    slope=+1
    elsif slope <0 then
    slope =-1
    endif
    res= sin(atan(slope+slope[1]+slope[2]))
    Fin=res-res[1]
    if fin >1.4  then
    buy 1 contract at market
    elsif fin <-1.4 then
    sellshort 1 contract at market
    endif
    if onmarket then
    // set stops and targets
    endif
    
    Nicolas and Fantasio2020 thanked this post
    #134242 quote
    Zigo
    Participant
    Master

    Voilà une example.

    PXI-1-minuutuitleg.png PXI-1-minuutuitleg.png
    #134251 quote
    Fantasio2020
    Participant
    Senior

    Ok Zigo…

    Doucement je commence à saisir, mais pourquoi utiliser les constantes (1.4 et -1.4)

    je ne comprends pas bien de quelle manière sont interprétés les résultats:

    a)+1 +1 +1 = 3       sin(atan(3)) = 0.94868

    b) +1 +1 -1 = 1       sin(atan(1)  = 0.70710

    c)+1-1-1 = -1          sin(atan(-1) = -0.70710

    d) -1-1-1 = -3         sin(atan(-3) = -0.94868

    Slts

    #134256 quote
    Fantasio2020
    Participant
    Senior

    Je n’obtient aucun résultats

    //Position acheteuse
    BuyConditionA = (Close > Pivot and Close > WMMA89 and Close > WMMA144 and Close > WMMA233 and Close > WMMA377)
    BuyConditionB = MyRSI < 38.2
    if buyconditionA and BuyConditionB and not daysForbiddenEntry then
    if fin > 1.4 then
    buy n share at market
    endif
    endif
    //Position Vendeuse
    SellConditionA = (Close < Pivot and Close < WMMA89 and Close < WMMA144 and Close < WMMA233 and Close < WMMA377)
    SellConditionB = MyRSI > 61.8
    if SellConditionA and SellconditionB and not daysForbiddenEntry then
    if fin < -1.4 then
    sellshort n share at market
    endif
    endif
    #134289 quote
    Zigo
    Participant
    Master

    Votre backtest ce n’est pas le même.

    Fantasio2020 thanked this post
    DOW-3-urenBT.png DOW-3-urenBT.png
    #134293 quote
    Fantasio2020
    Participant
    Senior

    Tu peux m’aider à corriger mon code?

    C’est difficile pour moi d’écrire le juste code qui fonctionne.

     

    Thanks

    #134294 quote
    Zigo
    Participant
    Master

    15 min

    Dans le marché entre 9u30 et 21u00

    Spread of 2 pips

    Backtest-slope-15min.png Backtest-slope-15min.png
    #134298 quote
    Fantasio2020
    Participant
    Senior

    Merci Zigo,

    mes résultats ne sont pas mauvais en intra-scalp 1 min….voir ci dessous avec spread de 2.4 pips.

    Mais je voudrais arrivé à obtenir un meilleur ratio Gain/Perte et je voudrais arriver à intégrer ta formule trigonométrique afin de pouvoir prendre position au bon moment sur la pente ascendante ou descendante…..

    Le problème que j’ai, c’est que je n’arrive pas à trouver une formule pour prendre position sur le pente à l’aide d’une variable ….et non sur d’une constante.

    J’ai déjà essayé plusieurs approches sans parvenir à dépasser le 60% Gain/Perte…

    Slts

    Dow-intra-scalp-Slope.png Dow-intra-scalp-Slope.png
    #134420 quote
    Fantasio2020
    Participant
    Senior

    Ci-joint la ixième version…

    //Indicateur de pente
    P=21
    Np=34
    
    EMA = TriangularAverage[P](Close)
    
    If EMA >= EMA[Np] Then
    Slope = (EMA - EMA[Np])/EMA[Np]
    elsif EMA < EMA[Np] Then
    Slope = (EMA - EMA[Np])/EMA
    Endif
    
    if slope > 0 then
    slope = 1
    elsif slope < 0 then
    slope = -1
    endif
     
    If (Slope + Slope[1] + Slope[2]) = 3 then 
    HighBull = Sin(Atan(3))
    elsif (Slope + Slope[1] + Slope[2]) = 1 then
    Bull = Sin(Atan(1))
    Elsif (Slope + Slope[1] + Slope[2]) = -1 then
    Bear = Sin(Atan(-1))
    Elsif (Slope + Slope[1] + Slope[2]) = -3 then
    HighBear = Sin(Atan(-3))
    Endif
    
    //************************************************************************
    //Gestion des Profits
    levier = 2
    capital = 500 + strategyprofit*0.5
    n = (capital / 1000) * levier
    
    //************************************************************************
    //Position acheteuse
    BuyConditionA2 = (Close > Pivot and Close > MMA100 and Close > MMA300 and Close > MMA600)
    BuyConditionB2 = Bull
    BuyConditionC2 = MyRSI < 38.2
    if buyconditionA2 and BuyConditionB2 and BuyConditionC2 and not daysForbiddenEntry then
    buy n/2 share at market
    endif
    
    BuyConditionA1 = (Close > Pivot and Close > MMA100 and Close > MMA300 and Close > MMA600)
    BuyConditionB1 = HighBull
    BuyConditionC1 = MyRSI < 38.2
    if buyconditionA1 and BuyConditionB1 and BuyConditionC1 and not daysForbiddenEntry then
    buy n share at market
    endif
    
    If Slope crosses under MMA100 then
    Sell at Market
    Endif
    
    //Position Vendeuse
    SellConditionA2 = (Close < Pivot and Close < MMA100 and Close < MMA300 and Close < MMA600)
    SellConditionB2 = Bear
    SellConditionC2 = MyRSI > 61.8
    if SellConditionA2 and SellconditionB2 and SellConditionC2 and not daysForbiddenEntry then
    sellshort n/2 share at market
    endif
    
    SellConditionA1 = (Close < Pivot and Close < MMA100 and Close < MMA300 and Close < MMA600)
    SellConditionB1 = HighBear
    SellConditionC1 = MyRSI > 61.8
    if SellConditionA1 and SellconditionB1 and SellConditionC1 and not daysForbiddenEntry then
    sellshort n share at market
    endif
    
    If Slope Crosses over MMA100 then
    Exitshort at Market
    Endif

    J’essaie de définir la taille des contrats en fonction de la ligne 20, 22, 24 et 26….

    mais je n’arrive pas à lui faire prendre la taille recherchée…

    Quelqu’un peut m’aider?

     

    Merci d’avance

Viewing 15 posts - 31 through 45 (of 55 total)
  • You must be logged in to reply to this topic.

Valeur de Slope pour la prise de position


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 54 replies,
has 3 voices, and was last updated by Fantasio2020
5 years, 9 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 05/28/2020
Status: Active
Attachments: 11 files
Logo Logo
Loading...