Volatility Scalper S1 V01
Forums › ProRealTime English forum › ProOrder support › Volatility Scalper S1 V01
- This topic has 48 replies, 10 voices, and was last updated 5 years ago by
robertogozzi.
-
-
04/03/2020 at 1:08 PM #124472
Hi,
I tried to make a strategy based on Volatility Scalper Indicator of Nicolas. As a reminder, this indicator detects the high volatility of market places. It’s the reflect when the market is making big move on the same bar.
This strategy is based on this indicator.
- When the value of the upside volume is considered as good, value > treshold and close > long MM, -> buy position is taken.
- When the value of the downside volume is considered as good, value > treshold and close < long MM, -> sell position is taken.
- Stop according to traling stop
- time 1530 – 2200, everyday
- option / reversal position size (possibility to activate or not)
- option for buy, sell or both
all suggestions are open…
- maybe specify more precise time ranges according to the volatility of DJI, same thing for different days… ?
- others ?
- …
- others.. ?
VOLATILITY SCALPER STRATEGY123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137//VOLATILITY SCALPER STRATEGY//@MAKSIDE - 2020//V0.1// Définition des paramètres du codeDEFPARAM CumulateOrders = False // Cumul des positions désactivé//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Volatility Scalper//@Nicolas/PRT// VariablesthreshATRPeriod = 40smoothing = 2verticalShiftPercent = 0// --threshATRPeriod = max(1, threshATRPeriod)smoothing = max(1, smoothing)diff = averagetruerange[1] - averagetruerange[2]if(close-close[1])>0 THENupsidevol = averagetruerange[1] + diff * 0.5upsideVol = max(upsideVol, 0)downsidevol = 0ELSEupsidevol = 0downsidevol = averagetruerange[1] + diff * 0.5downsideVol = max(downsideVol, 0)ENDIFt = DEMA[smoothing](AverageTrueRange[threshATRPeriod])t = t + (t*(verticalShiftPercent/100))//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//PARAMETERS OF STRATEGY **************************************//level of volatility indicator / bull marketCupsidevol = 10//level of volatility indicator / bear marketCdownsideVol = 20//buy conditionsCdatetimebuy = (CurrentTime > 153000) and currenttime < 220000//sell conditionsCdatetimesell = (CurrentTime > 153000) and currenttime < 220000Cbuy = upsidevol>Cupsidevol and upsidevol > t and CdatetimebuyCsell = downsidevol>CdownsideVol and downsidevol > t and Cdatetimesell// Strategy - 1 : buy, 2 : sell, 3 : bothCchoice = 2//Reverse martingale 1 : ON, 0 : OFFlevier = 1n = 1reversemartingale = 0//$$$$$$$$$$$$$$ REVERSE MARTINGALE// in case of loss, back to initial value 1// in case of winning, increase by one unit// in case of 4 consecutive wins, back to initial value 1if reversemartingale = 1 thenONCE n = levierIF Strategyprofit<Strategyprofit[1] THENn = levierENDIFIF Strategyprofit>Strategyprofit[1] THENn = n + levierENDIFIF n >= 6 * levier THEN // modifier la valeur selon vos préférencesn = levierENDIFendif//STRATEGY **************************************//if Cchoice = 1 or 3 thenif close > Average[4800](close) thenIF not longonmarket and Cbuy THENBUY n CONTRACT AT MARKETENDIFSET STOP pLOSS 5endifendifif Cchoice = 2 or 3 thenif close < Average[4800](close) thenIF not shortonmarket and Csell THENsellshort n CONTRACT AT MARKETENDIFSET STOP pLOSS 5endifendif//TRAILING STOP **************************************trailingstart = 15 //trailing will start @trailinstart points profittrailingstep = 5 //trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIF//************************************************************************04/03/2020 at 2:03 PM #12448404/03/2020 at 2:06 PM #124486Hi and thank you for your code!
Really like the stratergy. I was trying to put it live on my demo but gets an error just after I start it? Have checked the code and the only thing I changed was the ploss to 6 because that’s the min stopploss? But also tried with higher without succes.
04/03/2020 at 2:21 PM #124487Are you sure about the ploss set to 6 with IG account/DJI ?
please note, the gain is more important.. 862$ for my sample.. it’s 1.6 for the spread between 1530 – 2200 with IG.
In my example, i took 2 for the spread.
But you are right… i modified and try with different values for ploss and that the same thing.. bot rejected immediately
04/03/2020 at 2:30 PM #12448904/03/2020 at 2:34 PM #12449204/03/2020 at 2:40 PM #124494814$ with reversemartingale = 0
838$ with reversemartingale = 1
when this bot will work, be careful, please check this value because it’s not the value 1 which will be given to proorder but more if reversemartingale is on… (position size is increased in this case)
04/03/2020 at 3:42 PM #12450304/03/2020 at 4:19 PM #12451704/03/2020 at 4:58 PM #124527I don’t know.. I open a ticket through held desk center of PRT
i’m waiting and sure, i will come back soon 😉
I did the same 🙂
04/06/2020 at 8:47 AM #124758Try to add a a defparam preloadbards = 1000 at the top of the code.
You should also calculate your position size only before entering a new order, because now the “n” variable is calculating on each bar, even if you don’t meet the requirement to open a new position at market. So move the martingale code before line 79 and 91.
04/06/2020 at 10:03 AM #12478004/06/2020 at 10:26 AM #12479704/06/2020 at 10:32 AM #12479804/06/2020 at 10:44 AM #124802 -
AuthorPosts
Find exclusive trading pro-tools on
The topic ‘Volatility Scalper S1 V01’ is closed to new replies.