SAR + FIBONACCI

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

    Bonjour à tous,

    je suis tomber sur l’indicateur “scalping sar +fibo” et je tente de l’automatisé, étant débutant en programmation je vais a la pêche  ici et là pour former un petit code sympa

    et je suis tomber sur ce code ci dessous mais je n’arrive pas a le corriger, est ce que quelqu’un peut m’éclairer?

    Bonne journée.

    Defparam cumulateorders = False
    
    possize = 1
    plotbar = 10 //no of bars to keep stop orders valid
    buffer = 2*pointsize
    
    sarfast=SAR[0.02,0.02,0.2]
    sarslow=SAR[0.005,0.005,0.05]
    FibTarget = 1.618
    FibStop = 50 //Expressed as percentage
    
    //highs and lows
    if close sarfast and close[1] sarslow) or (barindex – startbar <= plotbar) then
    startbar = barindex
    irange = high – fibo0
    entry = fibo0 + (irange/(100/FibStop))
    itarget = fibo0 + irange*FibTarget
    istop = fibo0 – buffer
    Buy possize contract at entry-buffer stop
    Set stop ploss (entry-buffer) – (istop-buffer)
    Set target pprofit (itarget-buffer) – (entry-buffer)
    endif
    endif
    if (close sarfast[1]) Then//new bearish signal
    fibo0 = hh
    hh = 0 //reset hh
    if (close < sarslow) or (barindex – startbar <= plotbar) then
    startbar = barindex
    irange = fibo0 – low
    entry = fibo0 – (irange/(100/FibStop))
    itarget = fibo0 – irange*FibTarget
    istop = fibo0 + buffer
    Sellshort possize contract at entry+buffer stop
    Set stop ploss (entry+buffer) + (istop+buffer)
    Set target pprofit (entry+buffer) – (itarget+buffer)
    endif
    endif
    #216286 quote
    FXtonio
    Participant
    New

    Bonjour à tous,

    ci dessous un algo sur le dax en M30 spread 2

    je me suis inspiré de l’indicateur “PRC_ScalpingSAR and Fibonacci” disponible dans la bibliothèque.

    J’aurais besoin de votre aide pour programmer un stop sur les niveaux fibo de l’indicateur, ou un stop suiveur qui suit les points du SAR .

    ci-dessous:

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    
    // Empêche le système de placer des ordres pour entrer sur le marché ou augmenter la taille d'une position avant l'heure spécifiée
    noEntryBeforeTime = 080000
    timeEnterBefore = time >= noEntryBeforeTime
    
    // Empêche le système de placer des ordres pour entrer sur le marché ou augmenter la taille d'une position après l'heure spécifiée
    noEntryAfterTime = 180000
    timeEnterAfter = time < noEntryAfterTime
    
    // Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiés
    daysForbiddenEntry = OpenDayOfWeek = 5 OR OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    ////highs and lows
    if close<sarfast then
    ll=min(ll,low)
    else
    hh=max(hh,high)
    endif
    
    
    
    
    //indicateurs
    sarfast=SAR[0.02,0.02,0.2]
    sarslow=SAR[0.005,0.005,0.05]
    
    //stop loss
    set stop ploss 31
    set target profit 58
    
    // Conditions pour ouvrir une position acheteuse
    
    c1=close>sarfast and close[1]<sarfast[1]
    IF c1 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    
    c2=close<sarfast and close[1]>sarfast[1]
    IF c2 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    DAX-M30-PARABOLIC-SAR.itf ProBacktest-DAX-M30-PARABOLIC-SAR-.png ProBacktest-DAX-M30-PARABOLIC-SAR-.png
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

SAR + FIBONACCI


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
FXtonio @fxtonio Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by FXtonio
2 years, 8 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 06/13/2023
Status: Active
Attachments: 2 files
Logo Logo
Loading...