Bollinger Scalping eurusd M5

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #37374 quote
    TheAccountant
    Participant
    Average

    Hi !

    This is my first code. Very simple code I use manually.

    It works on eurusd in M5 but maybe in other forex/indices

    For now results on my demo account are the same as the backtest.

    Sorry for bad english 🙂

    Have a nice day.

    // 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 = 090000
    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 = 170000
    timeEnterAfter = time < noEntryAfterTime
    
    // Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiés
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Conditions pour ouvrir une position acheteuse
    indicator1 = BollingerDown[20](close)
    c1 = (close < indicator1)
    indicator2 = Average[50](close)
    c2 = (close > indicator2)
    
    IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
     BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour fermer une position acheteuse
    indicator3 = Average[20](close)
    c3 = (close CROSSES OVER indicator3)
    
    IF c3 THEN
     SELL AT MARKET
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    indicator4 = BollingerUp[20](close)
    c4 = (close > indicator4)
    indicator5 = Average[50](close)
    c5 = (close < indicator5)
    
    IF (c4 AND c5) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
     SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour fermer une position en vente à découvert
    indicator6 = Average[20](close)
    c6 = (close CROSSES UNDER indicator6)
    
    IF c6 THEN
     EXITSHORT AT MARKET
    ENDIF
    
    // Stops et objectifs
    SET STOP pLOSS 30
    
    Maz thanked this post
    bollinger-scalping-1496480312c4lp81.png bollinger-scalping-1496480312c4lp81.png bollinger-scalping-eurusd-M51.itf
    #37378 quote
    Nicolas
    Keymaster
    Master

    Thanks for sharing your automated strategy code. It seems to be not performing so well on a 200k bars backtest, that’s why I moved your post from the posts pending review list to the forum instead. However, the strategy is not bad, like many others based on mean reverting price behavior with triggers on Bollinger Bands. The fact that the moving average periods are not optimized is also encouraging.

    Maz thanked this post
    #37425 quote
    Maz
    Participant
    Veteran

    @Nicolas any chance you can post the 200k bar curve? This will give clues on curve fitting etc

    #37458 quote
    Nicolas
    Keymaster
    Master

    Please find it attached.

    eurusd-scalping-EA-results.png eurusd-scalping-EA-results.png
    #37478 quote
    victormork
    Participant
    Veteran

    Hi! We have discussed this type of strategy under the topic below. @theaccountant –  have a look, it might give you some new ideas.

    Scalping EURUSD

    #38386 quote
    TheAccountant
    Participant
    Average

    ok thank ! 🙂

    #38541 quote
    victormork
    Participant
    Veteran

    Btw try to change the starting time for the strategy. Starting this kind of strategy later in the day when the London open is over can improve the result.

    #38551 quote
    TheAccountant
    Participant
    Average

    hello !

    Yep i tried with different time but i think 9 to 17h gives me the best results 🙂

     

    I have improved the eurusd version since:

    // 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 = 090000
    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 = 170000
    timeEnterAfter = time < noEntryAfterTime
    
    // Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiés
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Conditions pour ouvrir une position acheteuse
    indicator1 = BollingerDown[20](close)
    c1 = (close < indicator1)
    indicator2 = Average[80](close)
    c2 = (close > indicator2)
    
    IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    BUY 5 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour fermer une position acheteuse
    indicator3 = Average[35](close)
    c3 = (close CROSSES OVER indicator3)
    
    IF c3 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    indicator4 = BollingerUp[20](close)
    c4 = (close > indicator4)
    indicator5 = Average[80](close)
    c5 = (close < indicator5)
    
    IF (c4 AND c5) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    SELLSHORT 5 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour fermer une position en vente à découvert
    indicator6 = Average[35](close)
    c6 = (close CROSSES UNDER indicator6)
    
    IF c6 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops et objectifs
    SET STOP pLOSS 30
    
    Francesco78 and victormork thanked this post
    bollingerscalping-eurusd-v2.png bollingerscalping-eurusd-v2.png
    #38553 quote
    TheAccountant
    Participant
    Average

    for now, result on demo account and backtest are the same.

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

Bollinger Scalping eurusd M5


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 8 replies,
has 4 voices, and was last updated by TheAccountant
8 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/04/2017
Status: Active
Attachments: 4 files
Logo Logo
Loading...