ALE

Smoothed Bollinger% Strategy Daily

Category: Strategies By: ALE Created: January 3, 2018, 1:36 PM
January 3, 2018, 1:36 PM
Strategies
38 Comments
Smoothed Bollinger% Strategy Daily

This strategy uses Smoothed Bollinger %b indicator, posted by Nicolas: “This is the modified% bollinger bands oscillator remade by Sylvain Vervoort. It’s using an Heiken Ashi closing price instead of the classic close value with Fears average. This indicator tend to accurate dark be and less choppy for intendifying turning points of the Dow theory by counting reverse oscillation of curved the”.

I have thought to post it because I believe that a winning portfolio must be founded on  daily strategies, that works with good values for a long time.
I don’t believe in the strategies with time frame inferior to the daily. And I believe that a winning portfolio must be composed from strategies that have little gain but costant,  It’s the whole portfolio that will bring to good results.

//Nicolas_Smoothed Bollinger %b indicator_11.12.2015
//Ale_Strategy_29.12.2017
//Market:US 100
//Time Frame: Daily
//No Tested on Real market yet

DEFPARAM CumulateOrders =  FALSE
ONCE avgEnterEnabled      = 1    //Moving Average Entry Filter - 0 OFF, 1 ON
ONCE trailingStopType     = 1    // Trailing Stop - 0 OFF, 1 ON
ONCE takeprofit           = 10   // Take Profit %
ONCE stoploss             = 5    // Stop Loss %
ONCE trailingstoplong     = 9    // Trailing Stop Atr Relative Distance
ONCE trailingstopshort    = 4    // Trailing Stop Atr Relative Distance
ONCE barlong              = 16   // Exit Time Long
ONCE barshort             = 2    // Exit Time Short
ONCE atrtrailingperiod    = 200  // Atr parameter Value
ONCE minstop              = 5    // Minimum Trailing Stop Distance

// MOVING AVERAGE - Parameter
ONCE avgLongPeriod          = 220 
// Smoothed Bollinger %b indicator - Parameters
ONCE period                 = 17
ONCE TeAv                   = 8
ONCE SveEnterLongThreshold  = 30
ONCE SveEnterShortThreshold = 90

// TRAILINGSTOP
//----------------------------------------------
atrtrail = AverageTrueRange[atrtrailingperiod]((close/10)*pipsize)/1000
trailingstartl = round(atrtrail*trailingstoplong)
trailingstartS = round(atrtrail*trailingstopshort)
if trailingStopType = 1 THEN
 TGL =trailingstartl
 TGS=trailingstarts
 if not onmarket then
  MAXPRICE = 0
  MINPRICE = close
  PREZZOUSCITA = 0
 ENDIF
 if longonmarket then
  MAXPRICE = MAX(MAXPRICE,close)
  if MAXPRICE-tradeprice(1)>=TGL*pointsize then
   if MAXPRICE-tradeprice(1)>=MINSTOP then
    PREZZOUSCITA = MAXPRICE-TGL*pointsize
   ELSE
    PREZZOUSCITA = MAXPRICE - MINSTOP*pointsize
   ENDIF
  ENDIF
 ENDIF
 if shortonmarket then
  MINPRICE = MIN(MINPRICE,close)
  if tradeprice(1)-MINPRICE>=TGS*pointsize then
   if tradeprice(1)-MINPRICE>=MINSTOP then
    PREZZOUSCITA = MINPRICE+TGS*pointsize
   ELSE
    PREZZOUSCITA = MINPRICE + MINSTOP*pointsize
   ENDIF
  ENDIF
 ENDIF
 if onmarket and PREZZOUSCITA>0 then
  EXITSHORT AT PREZZOUSCITA STOP
  SELL AT PREZZOUSCITA STOP
 ENDIF
ENDIF
//--------------------------------------------------------------------------------------------------
// FILTER SETTINGS
//--------------------------------------------------------------------------------------------------
//MOVING AVERAGE
longAvg  = Average[avgLongPeriod] (close)
avgFilterEnterLong  = (close>longAvg OR NOT avgEnterEnabled)
avgFilterEnterShort = (close<longAvg OR NOT avgEnterEnabled)

//Smoothed Bollinger %b indicator
haOpen = ((Open[1]+High[1]+Low[1]+Close[1])/4 + (Open[2]+High[2]+Low[2]+Close[2]))/2
haC = ((Open+High+Low+Close)/4 + haOpen + Max(high,haOpen) + Min(low,haOpen)) /4
TMA1 = tema[TeAv](haC)
TMA2 = tema[TeAv](TMA1)
Diff = TMA1-TMA2
ZlHA = TMA1+Diff
percb = (tema[TeAv](ZLHA)+2*STD[period](tema[TeAv](ZLHA))-weightedaverage[period](tema[TeAv](ZLHA))) / (4*STD[period](tema[TeAv](ZLHA)))*100
SveFilterEnterLong  = (percb < SveEnterLongThreshold  )
SveFilterEnterShort = (percb > SveEnterShortThreshold )

// STRATEGY
//--------------------------------------------------------------------------------------------------

IF NOT LongOnMarket AND avgFilterEnterLong AND SvEFilterEnterLong THEN
 BUY 1 CONTRACT AT MARKET
ENDIF


IF NOT ShortOnMarket AND avgFilterEnterShort AND SveFilterEnterShort THEN
 SELLSHORT 1 CONTRACT AT MARKET
ENDIF

 
IF  POSITIONPERF<0 THEN
 IF LongOnMarket AND BARINDEX-TRADEINDEX(1)>= barLong THEN
  SELL AT MARKET
 ENDIF
ENDIF

IF POSITIONPERF<0 THEN
 IF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= barshort  THEN
  EXITSHORT AT MARKET
 ENDIF
ENDIF

SET STOP %LOSS stoploss
SET TARGET %PROFIT Takeprofit

Download
Filename: US500_Smoo_Bo_Stgy_Daily-1.itf
Downloads: 776
Download
Filename: US100_Smoo_Bol_Stgy_Daily-1.itf
Downloads: 724
Download
Filename: PXI_Smoo_Bo_Stgy_Daily.itf
Downloads: 431
Download
Filename: HS_Smoo_Bol_Stgy_Daily-1.itf
Downloads: 420
Download
Filename: EURUSD_Smoo_Bo_Stgy_Daily-1.itf
Downloads: 930
Download
Filename: DOW_Smoo_Bo_Stgy_Daily-1.itf
Downloads: 628
Download
Filename: DAX_Smoo_Bo_Stgy_Daily-1.itf
Downloads: 1241
Download
Filename: US100_Smoo_Bol_Stgy_Daily-1.jpeg
Downloads: 673
Download
Filename: HS_Smoo_Bol_Stgy_Daily-1.jpeg
Downloads: 494
Download
Filename: DAX_Smoo_Bo_Stgy_Daily-1.jpeg
Downloads: 961
Download
Filename: BUND_Smoo_Bo_Stgy_Daily-1.jpeg
Downloads: 940
Download
Filename: EURUSD_Smoo_Bo_Stgy_Daily-1.jpeg
Downloads: 779
Download
Filename: BUND_Smoo_Bo_Stgy_Daily.itf
Downloads: 726
ALE
ALE Master
My name is Alessandro, i'm a trader since 2006 You can find me on my website: <a href="http://www.automatictrading.it/" rel="dofollow">www.automatictrading.it</a> <strong>(trading programming services Italy)</strong> Italy
Author’s Profile

Comments

Giuseppe68
6 years ago
#

Ciao, sono nuovo e poco esperto, volevo chiedere perchè il ProBacktest lo esegue correttamente, mentre se lancio la strategia nel ProOrder vengono rilevati errori come: "il code non è valido. Correggilo. Linea 22: Caratteri mancanti. Suggerimenti: fine del codice" e anche "L'istruzione "Graph" non può essere usata in modalità trading automatico". Qualcuno può spiegare perchè? grazie

macdopa
6 years ago
#

Hello ALE. Is there any way to help us develop or program an algo-strategy for automatic trading? Thank you in advance for working with us on this revolutionary strategy called: "kangaroo jump mouse nibbling".

LancerX
7 years ago
#

This catch my attention, tried to load in pro order but not coming through. What variables need to change?

Wester
8 years ago
#

HI, which values do I need to change before I can use it?

ALE
ALE
8 years ago
#

Hello Wester, you can change or not every variables that are in the code. if you need assistence , please write in the forum here: https://www.prorealcode.com/topic/smoothed-bollinger-strategy-daily_topic/

lumarino
9 years ago
#

Qual é então a sua Estrategia de eleição ALE??

ALE
ALE
8 years ago
#

Nasdaq!

lumarino
9 years ago
#

Bom dia Ale. Obrigado pela partilha. Você tem alguma das suas estratégias operando em Modo Real?? Quais são as estrategias? é com a IG? Obrigado.

ALE
ALE
9 years ago
#

OLÁ NESTE MOMENTO EU NÃO ESTOU USANDO ESTAS ESTRATÉGIAS DESDE QUE EU TENHO O CAPITAL OCUPADO PEQUENO EM OUTROS SISTEMAS. BROKER IG EU SOU USADO.

Ruark Baker
9 years ago
#

Hello, I have back tested you system and found that the ATR variable of 9 works well in low volatility situations but leads to a significant loss in February when the ATR had spiked. Would there be a way to add a variable such as a max trailing distance to allow for high volatility? Thanks

ALE
ALE
9 years ago
#

Very good

frovira
9 years ago
#

I've tested it and I can onl say that it is amazing! Many thanks !! If I can I will try to improve it, but for now it is working in my real account perfectly for EEUU 100 Tech and S&P. Many thanks for this big strategy!!

GiGi10
9 years ago
#

Buon giorno Alessandro e complimenti per la strategia. Sono un neofita di ProRealTime e di ProRealCode. Vorrei fare girare sul demo la tua strategia su EUR/USD per studiare ed imparare. Ho provato ad avviarla, ma senza successo, Mi puoi dare qualche consiglio? Pensavo che il file .ITF potesse già essere attivato su un conto demo. Grazie. Buon lavoro.

ALE
ALE
9 years ago
#

Hello Gigi Could you explain your question in the Topic?

ALE
ALE
9 years ago
#

Hello gigi, ok no problem I’ll explain it in the topic of This strategy

ALE
ALE
9 years ago
#

There is not a particular motive, that formula allows to find a relative value of the price, necessary to make to work the trailing stop in varying way and I don't fix.

lizmerrill
9 years ago
#

re:AverageTrueRange[atrtrailingperiod]((close/10)*pipsize)/1000, can you explain to how the input of ((close/10)*pipsize) is incorporated into the calculation of averagetruerange?

ALE
ALE
9 years ago
#

Hello maxgomma please use relative topic

maxgomma
9 years ago
#

Hello everyone .. I try to do backtest of the latest version of Pere gives me this error on line 78. Syntax error .. complete the syntax of this line ... SveFilterEnterLong = (percb SveEnterShortThreshold) How do you correct? thank you

Pere
9 years ago
#

If you remove the Takeprofit and the exit parts, and let work the trailing stop strategy, in the DAX strategy the results are better. I didn't try it in the other index. //Nicolas_Smoothed Bollinger %b indicator_11.12.2015 //Ale_Strategy_29.12.2017 //Market: Dax //Time Frame: Daily //No Tested on Real market yet DEFPARAM CumulateOrders = FALSE ONCE avgEnterEnabled = 1//AVGE //Moving Average Entry Filter - 0 OFF, 1 ON ONCE trailingStopType = 1//TRT // Trailing Stop - 0 OFF, 1 ON ONCE stoploss = SL100 // Stop Loss % ONCE trailingstoplong = TSL // Trailing Stop Atr Relative Distance ONCE trailingstopshort = TSS // Trailing Stop Atr Relative Distance ONCE atrtrailingperiod = ATRSP // Atr parameter Value ONCE minstop = MINSTP // Minimum Trailing Stop Distance // MOVING AVERAGE - Parameter ONCE avgLongPeriod = AVG // 100 // Smoothed Bollinger %b indicator - Parameters ONCE period = PRD ONCE TeAv = TEV ONCE SveEnterLongThreshold = SVL ONCE SveEnterShortThreshold = SVS // TRAILINGSTOP //---------------------------------------------- atrtrail = AverageTrueRange[atrtrailingperiod]((close/10)*pipsize)/1000 trailingstartl = round(atrtrail*trailingstoplong) trailingstartS = round(atrtrail*trailingstopshort) if trailingStopType = 1 THEN TGL =trailingstartl TGS=trailingstarts if not onmarket then MAXPRICE = 0 MINPRICE = close PREZZOUSCITA = 0 ENDIF if longonmarket then MAXPRICE = MAX(MAXPRICE,close) if MAXPRICE-tradeprice(1)>=TGL*pointsize then if MAXPRICE-tradeprice(1)>=MINSTOP then PREZZOUSCITA = MAXPRICE-TGL*pointsize ELSE PREZZOUSCITA = MAXPRICE - MINSTOP*pointsize ENDIF ENDIF ENDIF if shortonmarket then MINPRICE = MIN(MINPRICE,close) if tradeprice(1)-MINPRICE>=TGS*pointsize then if tradeprice(1)-MINPRICE>=MINSTOP then PREZZOUSCITA = MINPRICE+TGS*pointsize ELSE PREZZOUSCITA = MINPRICE + MINSTOP*pointsize ENDIF ENDIF ENDIF if onmarket and PREZZOUSCITA>0 then EXITSHORT AT PREZZOUSCITA STOP SELL AT PREZZOUSCITA STOP ENDIF ENDIF //-------------------------------------------------------------------------------------------------- // FILTER SETTINGS //-------------------------------------------------------------------------------------------------- //MOVING AVERAGE longAvg = Average[avgLongPeriod] (close) avgFilterEnterLong = (close>longAvg OR NOT avgEnterEnabled) avgFilterEnterShort = (close<longAvg OR NOT avgEnterEnabled) //Smoothed Bollinger %b indicator haOpen = ((Open[1]+High[1]+Low[1]+Close[1])/4 + (Open[2]+High[2]+Low[2]+Close[2]))/2 haC = ((Open+High+Low+Close)/4 + haOpen + Max(high,haOpen) + Min(low,haOpen)) /4 TMA1 = tema[TeAv](haC) TMA2 = tema[TeAv](TMA1) Diff = TMA1-TMA2 ZlHA = TMA1+Diff percb = (tema[TeAv](ZLHA)+2*STD[period](tema[TeAv](ZLHA))-weightedaverage[period](tema[TeAv](ZLHA))) / (4*STD[period](tema[TeAv](ZLHA)))*100 SveFilterEnterLong = (percb SveEnterShortThreshold ) // STRATEGY //-------------------------------------------------------------------------------------------------- IF NOT LongOnMarket AND avgFilterEnterLong AND SvEFilterEnterLong THEN BUY 1 CONTRACT AT MARKET ENDIF IF NOT ShortOnMarket AND avgFilterEnterShort AND SveFilterEnterShort THEN SELLSHORT 1 CONTRACT AT MARKET ENDIF SET STOP %LOSS stoploss //GRAPH TGL

ALE
ALE
9 years ago
#

thanks Pere, please uses the topic mentioned above to add further comments, analysis, test and contributions, thanks

ALE
ALE
9 years ago
#

Yes of course

Frank
9 years ago
#

Hi, will the strategy ever go short? In back-test it was only long trades...

maxgomma
9 years ago
#

Thanks for the availability ...

ALE
ALE
9 years ago
#

Yes, cancel graph function not else

maxgomma
9 years ago
#

Thanks Ale..ma for the Graph at the bottom of the code? how should i change it?

ALE
ALE
9 years ago
#

Hello Max Gomma, Thanks for your attention, I've open a Topic "Smoothed Bollinger% Strategy Daily_Topic" www.prorealcode.com/topic/smoothed-bollinger-strategy-daily_topic/

maxgomma
9 years ago
#

Hello Ale first of all congratulations for the strategy ... I'm asking you something .. if I try to put any of these strategies in real the system tells me: 1) I have to replace the variables with a specific value and I have to replace these variables with a specific numerical value in the code of the trading system 2) that the "Graph" instruction can not be used in automatic mode .. At this point, since I'm almost new to automatic trading, I'm asking for help on how to solve these two problems ... Meanwhile, thanks for the help and for all the work you do!

ProRealCode ProRealCode
Loading...