Candlestick Scalper 1s discussion
Forums › ProRealTime English forum › ProOrder support › Candlestick Scalper 1s discussion
- This topic has 171 replies, 16 voices, and was last updated 2 years ago by CMM.
-
-
04/10/2020 at 10:34 AM #12555504/10/2020 at 3:00 PM #125583
Do you use ATR for tralingstop on your 1s/10 strategy ?
Yes, tried the one you used too. Probably this one I like the most. Value 2 is nice for 1/10s with max 3. So this parameter doesn’t need to be optimised.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162// trailing stop atronce trailingstoptype = 1 // trailing stop - 0 off, 1 ononce trailingstoplong = 2 // trailing stop atr relative distanceonce trailingstopshort = 2 // trailing stop atr relative distanceonce atrtrailingperiod = 14 // atr parameter valueonce minstop = 10 // minimum trailing stop distance//----------------------------------------------atrtrail = averagetruerange[atrtrailingperiod]((close/10)*pipsize)/1000tgl = round(atrtrail*trailingstoplong)tgs = round(atrtrail*trailingstopshort)if trailingstoptype = 1 then//if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thenmaxprice = 0minprice = closenewsl = 0endif//if longonmarket thenmaxprice = max(maxprice,close)if maxprice-tradeprice(1)>=tgl*pointsize thenif maxprice-tradeprice(1)>=minstop thennewsl = maxprice-tgl*pointsizeelsenewsl = maxprice - minstop*pointsizeendifendifendifif shortonmarket thenminprice = min(minprice,close)if tradeprice(1)-minprice>=tgs*pointsize thenif tradeprice(1)-minprice>=minstop thennewsl = minprice+tgs*pointsizeelsenewsl = minprice + minstop*pointsizeendifendifendif//if longonmarket thenif newsl>0 thensell at newsl stopendifif newsl>0 thenif low < newsl thensell at marketendifendifendif//if shortonmarket thenif newsl>0 thenexitshort at newsl stopendifif newsl>0 thenif high > newsl thenexitshort at marketendifendifendifendif1 user thanked author for this post.
04/10/2020 at 3:05 PM #125584the analysis of a candle of a higher timeframe is the way for the exit
Maybe if a position runs bad. For a trade in profit probably the trailingstop would be good enough.
But it could also be used to prevent taking a trade. At the moment I’am testing that with the doji.
I don’t like to have too many indicators. One for the trend has to be enough.
1 user thanked author for this post.
04/10/2020 at 3:56 PM #125602I applied the re-enter code in same direction to the strategy.
If in a position and waiting for the trailingstop to be hit or the stoploss (or reversal signal), signals to enter in the same direction can appear which are ignored.
It’s interesting to see when they come and if the location is good or bad.
Maybe the most robust parameters are with this enabled when doing optimisation and then turn off going live.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849once reenter=1// entryif ctime thenIf (tradetype=1 or tradetype=2) thenif condbuy and not longonmarket thenbuy positionsize contract at markettradecounter=tradecounter+1tradecounterlong=tradecounterlong+1endifendif//if (tradetype=1 or tradetype=3) thenif condsell and not shortonmarket thensellshort positionsize contract at markettradecounter=tradecounter+1tradecountershort=tradecountershort+1endifendif//if reenter thenIf (tradetype=1 or tradetype=2) thenif condbuy and longonmarket thensell at marketendifendifIf (tradetype=1 or tradetype=2) thenif condbuy[1] and not longonmarket thenbuy positionsize contract at markettradecounter=tradecounter+1tradecounterlong=tradecounterlong+1endifendif//if (tradetype=1 or tradetype=3) thenif condsell and shortonmarket thenexitshort at marketendifendifif (tradetype=1 or tradetype=3) thenif condsell[1] and not shortonmarket thensellshort positionsize contract at markettradecounter=tradecounter+1tradecountershort=tradecountershort+1endifendifendifendif1 user thanked author for this post.
04/10/2020 at 7:45 PM #125619Hi,
this is an interesting project and I like the idea of candle patterns with few indicators.
I’ve had this idea of using Larry Williams “Smash Day Pattern”-strategy on lower Time Frames.
I think his idea is simply clever and may be useful.I’ve started a little project on my own, for educational purpose, with code name “SmashBar, the Larry style”…yeah I know, the name is…ehum…silly 🙂
If it’s OK, I’ll put the code here (if I break any forum rules please remove the code). As I mentioned, I’m still learning so my code might be a bit clumsy and probably not at all coded as the “Smash Day Pattern”. But hey, learning by doing, right? 😉I’ve got the idea from https://oxfordstrat.com/?s=smash and also found a topic here at prorealcode:
https://www.prorealcode.com/prorealtime-indicators/larry-williams-smash-days/SmashBar, the Larry style12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576//SmashBar, the Larry styledefparam cumulateorders = falsedefparam preloadbars = 5000once positionsize = 1once tradetype = 2 // [1]long&short;[2]long;[3]short//========= STRATEGY ===================================//longc10=low<lowest[2](low[1])c11=close<low[1]tradelong = c10 and c11//shortc20=high>highest[2](high[1])c21=close>high[1]tradeshort = c20 and c21//=======================================================// entryIf (tradetype=1 or tradetype=2) and tradelong thenif not onmarket thenbuy positionsize contract at marketendifendifif (tradetype=1 or tradetype=3) and tradeshort thenif not onmarket thensellshort positionsize contract at marketendifendif//%trailing stop functiontrailingPercent = .26 //org .26stepPercent = .015 //org .014if onmarket thentrailingstart = tradeprice(1)*(trailingpercent/100) //trailing will start @trailinstart points profittrailingstep = tradeprice(1)*(stepPercent/100) //% step to move the stopendif//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart THENnewSL = tradeprice(1)+trailingstepENDIF//next movesIF newSL>0 AND close-newSL>trailingstep THENnewSL = newSL+trailingstepENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart THENnewSL = tradeprice(1)-trailingstepENDIF//next movesIF newSL>0 AND newSL-close>trailingstep THENnewSL = newSL-trailingstepENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIF1 user thanked author for this post.
04/10/2020 at 7:52 PM #12562004/10/2020 at 7:56 PM #12562204/10/2020 at 7:57 PM #12562304/10/2020 at 8:01 PM #12562404/10/2020 at 10:28 PM #12563304/10/2020 at 11:24 PM #125635Thx
About 10s, not yet. But why not. I prefer 1s for the moment. Maybe under 1s, one day… We hope…
About the position size, it’s a dynamic positionsize according to the strategyprofit and the type of strategy
Currently btw 1 to 8 positionsize following the case. Dji 2$, spread 2.
I will post the different profit with and without and with différent spread btw 2 to 6.
04/11/2020 at 8:17 AM #125667maybe new pattern which can be coded, RWR pattern
1 user thanked author for this post.
04/11/2020 at 9:35 AM #125669the simplest is the most complicated.. i foresee an enormous work..
some ideas about candlestick strategies
- Identify all existing candlestick pattern and new patterns from existing strategies, code or recode them
- Give them a weighting on each bullish and bearish candlestick pattern according to historic statistics based on each market, each time slot
- Include an IA in order to reoptimize the decision tree and the weighted value according to the strategyprofit
- Optimize the money management or other parameters according to the new weighted value reoptimized previously
please find a document regarding the mathematic popularization of HFT … lot of interesting things (sorry, in french)
https://samm.univ-paris1.fr/IMG/pdf/High_Frequency_Trading_Modeling_and_Statistical_Arbitrage.pdf
04/11/2020 at 9:54 AM #125672So are you implementing MM in your tests?
BTW, i can suggest you the three black crows and three withe soldiers patterns if you didn’t knew it. I think it would be pretty easy to implement if you think it’s worth.
That could help the “searching all existing patterns”
04/11/2020 at 10:02 AM #125673 -
AuthorPosts
Find exclusive trading pro-tools on