Crows&Soldiers 2M
Forums › ProRealTime English forum › ProOrder support › Crows&Soldiers 2M
- This topic has 2 replies, 2 voices, and was last updated 5 years ago by
Francesco.
-
-
06/18/2020 at 1:44 PM #136431
Hey guys, this is a 2M strategy based on 3 crows and 3 soldiers candlestick patterns by Louis Winthorp III https://www.prorealcode.com/prorealtime-indicators/3-black-crows-3-white-soldiers/
It works on different timeframes with various indicators (MegaFX from Nicholas, Stock RSI from nonetheless and a Bullish and Bearish detection)
RT is pretty solid on 10-10, but not the best on 20-5 and 21-5; any suggestion for improvement is welcome.
Crows&Soldiers v1123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147// Crows&Soldiers v1 by Francesco// ProRealCode.comdefparam cumulateorders= falsen= 1timeframe (6 minutes, updateonclose)// Stoch RSIlengthRSI= 4 //RSI periodlengthStoch= 14 //Stochastic periodsmoothK= 5 //Smooth signal of stochastic RSIsmoothD= 5 //Smooth signal of smoothed stochastic RSImyRSI= RSI[lengthRSI](close)MinRSI= lowest[lengthStoch](myrsi)MaxRSI= highest[lengthStoch](myrsi)StochRSI= (myRSI-MinRSI) / (MaxRSI-MinRSI)K= average[smoothK](stochrsi)*100D= average[smoothD](K)cl= K>Dcs= K<Dtimeframe (4 minutes, updateonclose)// Bullish and Bearish Detectionma1= average[40](close)ma2= average[10](close)bullish= close>ma1 and close>ma2 and ma1>ma2ma11= average[40](close)ma21= average[10](close)bearish= close<ma11 and close<ma21 and ma11<ma21timeframe (2 minutes)// MegaFXperiod=5if barindex>period thenhhigh = highest[period](high)llow = lowest[period](low)mean = (High + Low) / 2.0temp = 0.66 * ((mean - llow) / (hhigh - llow) - 0.5) + 0.67 * Ld36temp = Min(Max(temp, -0.999), 0.999)mega = Log((temp + 1.0) / (1 - temp)) / 2.0 + result / 2.0Ld36 = tempresult = megaendifcondb= result>0conds= result<0// SettingsNbrCandles= 3Bodysize= 70 //in percentageBodySizeOnOff= 1 //standard 'On'//White Soldiersfor i=0 to NbrCandles-1 doCondSoldier = close[i] > open[i] and close[i] > close[i+1]If BodySizeOnOff thenCondBodySizeSoldier = (((close[i] - open[i]) / (high[i]- low[i])) > (BodySize / 100))if CondSoldier and CondBodySizeSoldier thenelseCondSoldier = 0breakendifelsif CondSoldier thenelseCondSoldier = 0breakendifnext//Black Crowsfor i=0 to NbrCandles-1 doCondCrows = close[i] < open[i] and close[i] < close[i+1]If BodySizeOnOff thenCondBodySizeCrows = (((open[i] - close[i]) / (high[i]- low[i])) > (BodySize / 100))if CondCrows and CondBodySizeCrows thenelseCondCrows = 0breakendifelsif CondCrows thenelseCondCrows = 0breakendifnext// Time Directionst= time>=000000 and time<=220000// Longif condsoldier=1 and condb and cl and bullish and t thenbuy n contract at marketendif// Shortif condcrows=1 and conds and cs and bearish and t thensellshort n contract at marketendif// Stop Lossset stop %loss 0.6//%trailing stop functiontrailingPercent = 0.29stepPercent = 0.23if onmarket thentrailingstart = tradeprice(1)*(trailingpercent/100) //trailing will start @trailingstart points profittrailingstep = tradeprice(1)*(stepPercent/100) //% step to move the stoplossendif//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 STOPENDIF06/18/2020 at 5:36 PM #13649506/18/2020 at 7:40 PM #136511You can easily copy and paste the code in your platform; anyway here it is in attachment.
I forgot to mention than the strategy can be used on any forex pair and maybe on indexes with a proper optimization, but I feel like it misses something to reach a “live account” stability.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on