Stratégie MTF avec les bands de Mogalef

Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #103455 quote
    Nicolas
    Keymaster
    Master

    Hmmm, supprime donc la ligne du preloadbars.

    #141888 quote
    Madrosat
    Participant
    Master

    Bonjour Nicolas

    réponse très tardive excuse moi oui ça a marché

    Peux tu m’aider??

    je voudrais prendre en compte les niveaux  précédents des bandes pour m’en servir de tp ou stoploss

    comment dois je opérer sachant que ça peut être 1 bougie avant ou 5 ou 8 bougies etc… avant l’entrée en trade j’ai consulté plein de forum mais

    j’ai pas trouvé …Je cale

    Bonnes vacances  et Merci de ton aide quand tu pourras

    #141902 quote
    Nicolas
    Keymaster
    Master

    Quelle est la méthode que tu utilises pour déterminer le TP/SL avec ces niveaux ? Si tu pouvais le décrire, je pourrai mieux t’indiquer la façon de le coder 🙂

    #141922 quote
    Madrosat
    Participant
    Master
    //////////////////////////////////////////////////////////////////
    //// Madrosat IB Str opt etBMO Ka suite de Sport Gold (E1 Contract) Spread 0.5
    //////////////////////////////////////////////////////////////////
    
    DEFPARAM CumulateOrders = False
    DEFPARAM PreloadBars    = 200
    
    //////////////////////////////////////////////////////////////////
    //// Opti
    //////////////////////////////////////////////////////////////////
    
    longtrigger     = 9
    shorttrigger    = 91
    
    maperiod        = 100
    
    maPeriod1       = 20 // Moving Average Period 100
    maType1         = 2   // Moving Average function
    
    stoplossmulti   = 5
    possize         = 1
    
    //////////////////////////////////////////////////////////////////
    //// Indicators
    //////////////////////////////////////////////////////////////////
    
    IBS =  (Close - Low) / (High - Low) * 100
    ma = average[maperiod](close)
    
    ma1 = average[maPeriod1, maType1](customClose)
    slope1 = ma1 - ma1[1]
    
    
    //////////////////////////////////////////////////////////////////
    //// Entry conditions
    //////////////////////////////////////////////////////////////////
    
    b1 = not longonmarket               // only open 1 position
    b1 = b1 and close < Dhigh(1)        // close below yesterday's high
    b1 = b1 and IBS < longtrigger       // Internal bar strength below trigger value
    b1 = b1 and close > ma              // close over moving average
    b1 = b1 and slope1 > 0              // ma slope is positive
    
    
    s1 = not shortonmarket              // only open 1 position
    s1 = s1 and close > Dlow(1)         // close above yesterday's low
    s1 = s1 and IBS > shorttrigger      // Internal bar strength below trigger value
    s1 = s1 and close < ma              // close over moving average
    s1 = s1 and slope1 < 0              // ma slope is negative
    
    
    //////////////////////////////////////////////////////////////////
    //// Exit conditions Short
    //////////////////////////////////////////////////////////////////
    
    el1 = close > Dhigh(1)              // close above yesterday's high
    
    es1 = close < Dlow(1)               // close below yesterday's low
    
    //////////////////////////////////////////////////////////////////
    //// Execution
    //////////////////////////////////////////////////////////////////
    ignored, ignored, indicator1 = CALL "Bandes de mogalef"
    indicator2 = CALL "Moyenne adaptative kama"[3, 3, 8]
    c1 = (indicator2 < indicator2[1])and (indicator2[1]> indicator2[2]) and (indicator2[2]> indicator2[3]) and (indicator2[3]> indicator2[4]) and (indicator2[4] > indicator2[5])
    
    if b1 and not c1 then
    buy possize contract at market
    valeura = indicator1
    endif
    indicator3, ignored, ignored = CALL "Bandes de mogalef"
    c2 = (indicator2 > indicator2[1])and (indicator2[1]< indicator2[2]) and (indicator2[2]< indicator2[3]) and (indicator2[3]< indicator2[4]) and (indicator2[4] < indicator2[5])
    if s1 and not c2 then
    sellshort possize contract at market
    valeurb = indicator3
    endif
    el2 = close< valeura
    if el1 or el2 then
    sell at market
    endif
    es2 = close > valeurb
    if es1 or es2  then
    exitshort at market
    endif
    
    Nicolas voici une stratégie avec Bmo 
    //////////////////////////////////////////////////////////////////
    //// Stop loss
    //////////////////////////////////////////////////////////////////
    
    set stop ploss (averagetruerange[14] * stoplossmulti)/pointsize
    //graph (averagetruerange[14] * stoplossmulti)/pointsize
    //ignored, ignored, indicator3 = CALL "Bandes de mogalef"
    //graph valeura
    //graph valeurb
    ///indicator1 = CALL "Moyenne adaptative kama"[3, 3, 8]
    ///c1 = (indicator1 >= close[1])

    Rebonjour Nicolas

    j’ai inséré le code stratégie avec bouton insert et fait une copie d’écran si la stratégie te parait interessante tu peux la publier elle semble bien fonctionner sur EUR USD 1H

    Capture-d’écran-2020-08-18-à-14.42.00.png Capture-d’écran-2020-08-18-à-14.42.00.png
    #141968 quote
    Nicolas
    Keymaster
    Master

    Désolé je n’ai pas l’indicateur “bandes de mogalef” sur ma plateforme, mais je suppose que la ligne médiane, c’est celle du milieu dans le CALL, donc en gros pour récupérer la valeur de cette ligne quand elle change, on stocke sa valeur précédente dans une variable et on l’utilisera pour placer le stoploss :

    //appel de la ligne mediane 
    ignored, mediane, ignored = CALL "Bandes de mogalef"
    
    //si pas d'ordres courants, alors on enregistre la valeur de la mediane quand elle change
    if not onmarket then  
     if mediane<>mediane[1] then 
      niveauSL = mediane[1]
     endif 
    endif
    
    // si au marché, on place nos seuils de sorties (stoploss)
    if longonmarket then 
     sell at niveauSL stop
    elsif shortonmarket then 
     exitshort at niveauSL stop
    endif

    (non testé)

    #141973 quote
    Madrosat
    Participant
    Master

    Bonjour et grand merci Nicolas

    je me mets au travail pour inclure cette disposition et la tester

    Bonne journée

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

Stratégie MTF avec les bands de Mogalef


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Madrosat @madrosat Participant
Summary

This topic contains 20 replies,
has 2 voices, and was last updated by Madrosat
5 years, 6 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 02/07/2019
Status: Active
Attachments: 3 files
Logo Logo
Loading...