Bollinger+fractal strategy idea

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #230417 quote
    Monochrome
    Participant
    Senior

    Here is a draft strategy that i have shelved a while ago.

    Its a mean reversion strategy where entries are made after bollinger bounce and fractal cross. On DJI 1 min.

    It has no optimisations which i believe makes it more robust. With no spread and Over 200k and 1million bars shows a steady growth.

    Its an INCOMPLETE strategy but i believe the concept has some potential because its simple.

    I want to share with you all so we can scrutinise and drop this strategy or develop this more to a complete strategy.

    DEFPARAM PRELOADBARS = 2000
    DEFPARAM cumulateOrders = false
    DEFPARAM FlatBefore = 080000
    DEFPARAM FlatAfter = 205000
    
    ST1 = Supertrend[1.5, 10]
    ST2 = Supertrend[2.5, 10]
    
    
    bbup = BollingerUp[20](close)
    bbdn = BollingerDown[20](close)
    
    
    BearishFractal = ((high[1] > high[2] AND high[1] > high) and close<=close[1] and close<=open[1] and close[1]=>open[2] and low<low[1]) or (high[1]>high and high[1] >high[2] and low[1]>low and low[1]>low[2])
    BullishFractal = ((low[1] < low[2] AND low[1] < low)  and close=>close[1] and close=>open[1] and close[1]<=open[2] and high>high[1]) or (low[1]<low and low[1]<low[2] and high[1]<high and high[1]<high[2])
    
    IF BearishFractal THEN
    BearishFractalPoint = high[1]
    ENDIF
    
    IF BullishFractal THEN
    BullishFractalPoint = low[1]
    ENDIF
    
    
    //High and Low
    if high crosses over bbup then
    selltag = 1
    buytag = 0
    
    endif
    
    if low crosses under bbdn  then
    selltag = 0
    buytag = 1
    
    endif
    
    
    buycond = buytag and close crosses over BearishFractalPoint and not BullishFractalPoint=0
    sellcond = selltag and close crosses under BullishFractalPoint and not BearishFractalPoint=0
    
    
    if   buycond  THEN
    BUY 1 CONTRACT AT  market
    set stop loss min(50,max(10,(close-(BullishFractalPoint-5*pipsize))))
    endif
    
    
    if  sellcond   THEN
    SELLSHORT 1 CONTRACT at market
    set stop loss min(50,max(10,((BearishFractalPoint+5*pipsize)-close)))
    ENDIF
    
    
    
    //Exit strategy
    if longonmarket and close>tradeprice then
    if (high > bbup and close > (tradeprice + 10*pipsize))  then
    sell at (tradeprice + 10) stop
    endif
    if (st1 - tradeprice) > 50*pipsize and close crosses under st1 then
    sell at market
    elsif (st1 - tradeprice) > 10*pipsize and (st1 - tradeprice) <= 50*pipsize then
    sell at st1 stop
    endif
    endif
    
    if shortonmarket and close<tradeprice then
    if low < bbdn and close < (tradeprice - 10*pipsize)  then
    exitshort at (tradeprice - 10) stop
    endif
    if (tradeprice - st1) > 50*pipsize and close crosses over st1 then
    exitshort at market
    elsif (tradeprice - st1) > 10*pipsize and (tradeprice - st1) <= 50*pipsize then
    exitshort at st1 stop
    endif
    endif
    
    
    if low > BearishFractalPoint then
    BearishFractalPoint = 0
    endif
    if high < BullishFractalPoint then
    BullishFractalPoint = 0
    endif
    
    robertogozzi and KumoNoJuzza thanked this post
    CleanShot-2024-03-22-at-14.02.12@2x.jpg CleanShot-2024-03-22-at-14.02.12@2x.jpg CleanShot-2024-03-22-at-14.03.02@2x.jpg CleanShot-2024-03-22-at-14.03.02@2x.jpg
    #230420 quote
    robertogozzi
    Moderator
    Master

    Thanks for sharing it 🙂

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

Bollinger+fractal strategy idea


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Monochrome @monochrome Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
1 year, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/25/2024
Status: Active
Attachments: 2 files
Logo Logo
Loading...