Grid orders with one combined stop loss and limit, can it be done?
Forums › ProRealTime English forum › ProOrder support › Grid orders with one combined stop loss and limit, can it be done?
- This topic has 307 replies, 1 voice, and was last updated 7 months ago by OtherAttorney.
-
-
10/16/2016 at 3:44 PM #14975
Good question Cosmic, I use the values in my recent post. The grid step is at each traders discretion but the smaller the min step and the tighter entries gives a smaller margin for retracements before being stopped out. Sometimes I might use smaller values when anticipating a strong but brief move for 50-100 pips or so.
Regarding the ATR it is open for discussion, we get a smoother more balanced scale with higher values which I belive is more profitable since the really big money is when entering 10 positions or when there is a strong trend for several hours or a day or two which needs room for retracement hence taking into account ATR of more than just the last few minutes or hours but again I encourage everyone to try different values. These ones are good and work but most likely there are better ones we are yet to try.
As for the indicator settings, I’m comfortable with the Coppock values on M1 being equal to M15 and likwise for CCI being equal to M5 but I have considered changing MACD to be equal to H1 instead of M15 and also changing ADX from 14 to 70 for it to equal M5 rather than just M1. The set of these settings can also be improved, preferably we would have 3 different set of values depending on market conditions and volatility.
10/17/2016 at 5:38 PM #15053Modified code to limit one trade per day without having to re-start after each trade – added LastTradeDate parameter. Note code use the first trade as LastTradeDate. If you want to use last trade placed, then remove the remark on line 49. Do run test in your time zone to determine OpenDate cut-off time.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990/// Definition of code parametersdefparam preloadbars =10000DEFPARAM CumulateOrders = true // Cumulating positions deactivatedOnce LastTradeDate = 0COI= WEIGHTEDAVERAGE[210](ROC[165] +ROC[150])MAC= MACDline[180,390,135]CCC= CCI [60]AAA= ADX [14]once RRreached = 0accountbalance = 10000 //account balance in money at strategy startriskpercent = 2 //whole account risk in percent%amount = 1 //lot amount to open each traderr = 2 //risk reward ratio (set to 0 disable this function)sd = 0.25 //standard deviation of MA floating profit//dynamic step gridminSTEP = 10 //minimal step of the gridmaxSTEP = 50 //maximal step of the gridATRcurrentPeriod = 60 //recent volatility 'instant' periodATRhistoPeriod = 600 //historical volatility periodATR = averagetruerange[ATRcurrentPeriod]histoATR= highest[ATRhistoPeriod](ATR)resultMAX = MAX(minSTEP*pipsize,histoATR - ATR)resultMIN = MIN(resultMAX,maxSTEP*pipsize)gridstep = (resultMIN)// Conditions to enter long positionsc1 = (COI > COI[1])c2 = (COI > 0)c3 = (MAC > MAC[1])c4 = (MAC > 0)c5 = (CCC CROSSES OVER 0)c6 = (AAA > AAA[1])c7 = (AAA > 23)//first trade whatever conditionif NOT ONMARKET AND HIGHEST[3](c1)=1 AND HIGHEST[3](c2)=1 AND HIGHEST[3](c3)=1 AND HIGHEST[3](c4)=1 AND HIGHEST[3](c5)=1 AND HIGHEST[3](c6)=1 AND HIGHEST[3](c7)=1 And LastTradeDate<>OpenDate then //close>close[1]BUY amount LOT AT MARKETLastTradeDate = OpenDateendif// case BUY - add orders on the same trendif longonmarket and close-tradeprice(1)>=gridstep*pipsize thenBUY amount LOT AT MARKET//LastTradeDate = OpenDateendifgraph lasttradedate as "Lasttradedate"graph opendate as "Opendate"//money managementliveaccountbalance = accountbalance+strategyprofitmoneyrisk = (liveaccountbalance*(riskpercent/100))if onmarket thenonepointvaluebasket = pointvalue*countofpositionmindistancetoclose =(moneyrisk/onepointvaluebasket)*pipsizeendif//floating profitfloatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize//actual trade gainsMAfloatingprofit = average[40](floatingprofit)BBfloatingprofit = MAfloatingprofit - std[40](MAfloatingprofit)*sd//floating profit risk reward checkif rr>0 and floatingprofit>moneyrisk*rr thenRRreached=1endif//stoploss trigger when risk reward ratio is not met alreadyif onmarket and RRreached=0 thenSELL AT positionprice-mindistancetoclose STOPendif//stoploss trigger when risk reward ratio has been reachedif onmarket and RRreached=1 thenif floatingprofit crosses under BBfloatingprofit thenSELL AT MARKETendifendif//resetting the risk reward reached variableif not onmarket thenRRreached = 0endif10/17/2016 at 5:41 PM #15054Apologies for posting in trading thread earlier! You mentioned that you are using Mike’s screeners to find markets but you had or were going to modify them. Are you running those modified screeners now or still manually looking? I think it’s important that we all have the same screener code when we are looking for setups that follow the same base rules so we can post in the trading thread with the same kind of setup. What do you think?
1 user thanked author for this post.
10/17/2016 at 7:53 PM #15061No worries Cosmic, I realize it’s easy to forget, you and everyone else is very welcome to post in this thread 🙂
That’s right, I still use Mike’s screeners but intend to modify them to match the current code parameters but I haven’t even started yet, I anyone else feel inclined to modify them please go ahead since my coding skills are still very modest and basic. Indeed using screeners with the same settings is a major benefit to detect trades and setups.
@ Sylvess
Great initiative and developement, keep the ideas coming!
10/18/2016 at 7:37 AM #15081This is just a copy and paste from MikeGC’s code but with stochastic removed and CCI added. cfta and others, could you check that this is correct?
Screener:
12345678910111213//Trend Chaser Bullish Screenerindicator1 = CALL "MGC-Coppock" (close)c1 = (indicator1 > indicator1[1])indicator2 = MACDline[12,26,9](close)C2 = (indicator2 > indicator2[1])indicator3 = CCI[12](close)C3 = (indicator3 > 0)C4 = (indicator3 > indicator3[1])SCREENER[C1 AND C2 AND C3 AND C4] (Variation AS "%Chg prev bar")Indicator saved as MGC-Coppock:
1RETURN WEIGHTEDAVERAGE[10](ROC[14]+ROC[11]) AS "Coppock Indicator"1 user thanked author for this post.
10/19/2016 at 3:33 PM #1518010/19/2016 at 7:02 PM #15190Thanks cfta, it showed on both 1h+4h this morning. I started the system with the 5 steps code from Nicolas at around 11370 but unfortunately it didn’t fall within spec until around 11343. 4 trades short were taken @11343 @11333 @11327 @11321 this showed around £50 profit but didn’t quite get to my target of 11300/11305 but instead reversed at 11312 so I decided to pull them for near breakeven as you can see as I had to leave the computer. Nice to take live and get used to the system. Good things to come I’m sure.
10/26/2016 at 5:49 PM #15578Hi Guys. I have been following this post for quite some time- left it and came back. This weekend I read the whole post again and decided to begin some demo trades on the manual part.
I must say that since it’s a long development process with lots of try-outs, one easily gets lost if you weren’t really testing all the codes along with the developments, which I didn’t. Big applause for both Nikolas and CFTA. Great team work and effort to achieve what has been done. I apologies in advance if I forgot something in the long post, or obvious noob questions that may come.
Two things I’d like to achieve.
Code and Entry. With the entry part I’d like to make the screener or indicator, also to better to understand the setup- filtering out all the information here and on forexfactory. Boiling it down to a few simple lines.
I made 3 trades with the same code. There are still findings that I think needs to be addressed or at least explained.
The first DAX trade. The other has similar errors. The third is running as designed.
As you can see on the screen dumps I have a TF 4H, 1H and 1min. The code is executed on a 1 sec TF.
Entry at 24 Oct 20:10 It looks like there was a retracement before going long again. I see this on the 1H TF. It was not matching the setup according to CFTA but I thought there was more in the DAX to trade it. It would also leave me with a test trade.
Anyway If I simulate or back tested this It would leave me with a profit- however the real trade did leave me with a 1% loss.
I decided to go with 1% risk and RR=2 which should leave me with 200eur if won or -100eur if loosing.
Simulated trades on 1s TF wins with 169 EUR and 1m TF wins with 116 EUR, but the demo proorder looses with 100 EUR.
Shouldn’t it still loose in the simulation because of the rr=2?
Also around 02:08 it closes 1 position of the 3 in the trade?
Why this behaviour?
I tried to read the forexfactory link but I didn’t think the description of how to enter the trade was clear to me. Perhaps because I’m not familiar with MT4 and some of the indicators there and also that I’m still generally new to trading. So this is what I came up with from this post. I tried to setup the indicators from one of CFTA’s screen dumps.
Long entry
- Coppock rising curve under the 0 line- red in my scrn dump. Best from the lowest peak
- MACD minus signal like wise- however I discovered that when MACD and signal lines crosses, it’s also a strong indication for entry (manually sampled)
- CCI needs to cross over the 0 line.
- ADX needs to be above 25 to signal a strong trend.
- Heikin-Ashi needs to be green candle
But I cannot determine if this need to be true to both 4H and 1H TF before trying to pick the entry on a 15 or 1 min TF? Can you point me in the right direction? Also any advise in my perseption here would be welcome 🙂
Cheers Kasper
Here’s the code I used.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152//-------------------------------------------------------------------------// Main code : DAX CFTA LONG//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Main code : LONG GRID BB Exit//-------------------------------------------------------------------------defparam preloadbars = 100once RRreached = 0//parametersaccountbalance = 10000 //account balance in money at strategy startriskpercent = 1 //whole account risk in percent%gridstep = 10 //grid step in pointamount = 1 //lot amount to open each traderr = 2 //risk reward ratio (set to 0 disable this function)//first trade whatever conditionif NOT ONMARKET AND close>close[1] AND STRATEGYPROFIT=0 thenBUY amount LOT AT MARKETendif// case BUY - add orders on the same trendif longonmarket and close-tradeprice(1)>=gridstep*pipsize thenBUY amount LOT AT MARKETendif//money managementliveaccountbalance = accountbalance+strategyprofitmoneyrisk = (liveaccountbalance*(riskpercent/100))if onmarket thenonepointvaluebasket = pointvalue*countofpositionmindistancetoclose =(moneyrisk/onepointvaluebasket)*pipsizeendif//floating profit//floatingprofit = ((close-positionprice)*pointvalue)*countofpositionfloatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize //actual trade gainsMAfloatingprofit = average[20](floatingprofit)BBfloatingprofit = MAfloatingprofit - std[20](MAfloatingprofit)*2//floating profit risk reward checkif rr>0 and floatingprofit>moneyrisk*rr thenRRreached=1endif//stoploss trigger when risk reward ratio is not met alreadyif onmarket and RRreached=0 thenSELL AT positionprice-mindistancetoclose STOPendif//stoploss trigger when risk reward ratio has been reachedif onmarket and RRreached=1 thenif floatingprofit crosses under BBfloatingprofit thenSELL AT MARKETendifendif//resetting the risk reward reached variableif not onmarket thenRRreached = 0endif10/26/2016 at 6:31 PM #15585Okay so I decided to work a bit on the indicator. Much easier to work with indicators- to get the right setup before doing the screener. One problem with the screener could take hours of waiting time- not sure if it works or not. Making the indicator should backtest this problem 🙂
here is the indicator I made. Please test it and let us adjust it to suit the entry.
I pretty much based it on the assumption from my last post
cheers Kasper
1234567891011121314151617181920212223242526272829303132333435363738394041424344//***************LongHistogram1 = MACD[12,26,9](close)//HistogramBlue1 = MACDline[12,26,9](close)//BLÅ linered1 = ExponentialAverage[9](MACDline[12,26,9](close))//RØD LineADX1 = ADX[14]c1 = (blue1 CROSSES OVER red1)c11 = Blue1<0c2 = (Histogram1 CROSSES OVER 0)c4 = (ADX1 > 25)//c5= ADX1>ADX1[1]indicator2 = CALL "MGC-Coppock"[14, 11, 10](close)c12 = (indicator2 > indicator2[1])If c1 and c2 and c12 and c4 and c11 thenIndicator1=1ElseIndicator1=0Endif//*************ShortHistogram2 = MACD[12,26,9](close)//HistogramBlue2 = MACDline[12,26,9](close)//BLÅ linered2 = ExponentialAverage[9](MACDline[12,26,9](close))//RØD LineADX2 = ADX[14]c22 = (blue2 CROSSES Under red2)c21 = Blue2>0c222 = (Histogram2 CROSSES under 0)c242 = (ADX2 > 25)//c55= ADX1<ADX1[1]indicator2 = CALL "MGC-Coppock"[14, 11, 10](close)c122 = (indicator2 < indicator2[1])If c22 and c21 and c122 and c242 and c222 thenIndicator22=-1ElseIndicator22=0EndifReturn indicator1 COLOURED(0,255,0) as "Buy", indicator22 COLOURED(255,0,0) as "Sell"1 user thanked author for this post.
10/26/2016 at 7:50 PM #155933rd post this evening. Think I need go to sleep, but before I do this I’d like to give something back to this thread.
Thought you might like this
I saw somewhere that you thought the JPY FX was wrong and we needed to add decimal factor. I don’t know if you cracked it yourself, but anyway I think the reason is this.
For doing the trades in JPY one simply needs to convert the EUR to JPY. Nothing wrong with the code even if you were stopped out long before expected. it is calculated in JPY and 10000 JPY is around 80 EUR and 1% af 80 is 0,8 EUR. that why you get stopped out.. at -0,8 EUR and not 100 EUR as expected.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051//-------------------------------------------------------------------------// Main code : USDJPY CFTA SHORT//-------------------------------------------------------------------------defparam preloadbars = 100once RRreached = 0//parametersEuro = 10000JPYConversion=113.9703//daily conversion rate for Euro/JPYaccountbalance = Euro*JPYConversion //account balance in money at strategy startriskpercent = 1 //whole account risk in percent%gridstep = 10 //grid step in pointamount = 1 //lot amount to open each traderr = 2 //risk reward ratio (set to 0 disable this function)//first trade whatever conditionif NOT ONMARKET AND close<close[1] AND STRATEGYPROFIT=0 thenSELLSHORT amount LOT AT MARKETendif// case SELL - add orders on the same trendif shortonmarket and tradeprice(1)-close>=gridstep*pipsize thenSELLSHORT amount LOT AT MARKETendif//money managementliveaccountbalance = accountbalance+strategyprofitmoneyrisk = (liveaccountbalance*(riskpercent/100))if onmarket thenonepointvaluebasket = pointvalue*countofpositionmindistancetoclose =(moneyrisk/onepointvaluebasket)*pipsizeendif//floating profit//floatingprofit = ((close-positionprice)*pointvalue)*countofpositionfloatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize //actual trade gainsMAfloatingprofit = average[20](floatingprofit)BBfloatingprofit = MAfloatingprofit - std[20](MAfloatingprofit)*2//floating profit risk reward checkif rr>0 and floatingprofit>moneyrisk*rr thenRRreached=1endif//stoploss trigger when risk reward ratio is not met alreadyif onmarket and RRreached=0 thenEXITSHORT AT positionprice-mindistancetoclose STOPendif//stoploss trigger when risj reward ratio has been reachedif onmarket and RRreached=1 thenif floatingprofit crosses under BBfloatingprofit thenEXITSHORT AT MARKETendifendif//resetting the risk reward reached variableif not onmarket thenRRreached = 0endif1 user thanked author for this post.
10/31/2016 at 7:22 PM #15792Hi Kasper,
Very creative indeed, great initiative with the indicator and JPY issue 🙂
I reviewed your trades and the code and can’t really figure out what the problem is but remember to adjust the parameters when running the code on 1 sec instead of 1 min. Also as I posted before, sometimes entries were taken to closely and the system did not respect the min grid step which I found a solution for, in your code you would need to change line 20 to;
“if longonmarket and close-tradeprice(1)>=gridstep then”
NOTE to fellow readers, the code elsborgtrading posted is the older version without the entry parameters which MikeGC introduced and I changed.
10/31/2016 at 7:39 PM #15793Well the volatility and trade drought drags on with quite few trade opportunities. As I mentioned I while ago I would like to have a set of different codes to suit various market conditions, I have been trying to write an additional set of code suited for low volatility conditions and for short term trades aiming for smaller moves, this will generate more entries but also require more monitoring for when to start the system and may often need manual exits to be profitable.
The difference in the code is that the CCI period has been changed from 60 to 20 (20 being the default period for the indicator), Coppock has been adjusted to equal M5 instead of M15 and the conidtions for the Coppock and MACD to be above 0 for long and below for short has been removed. I intend to replace it with conditions for Coppock, MACD and ADX to be rising for the last five periods for longs and falling for shorts (except for ADX which should be rising).
I thought I had the rising or falling condition for the last five periods figured out but as I am posting this I realize I do not, coders with better skills are more than welcome to provide guidance or adjust the code 🙂
Long:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182/// Definition of code parametersdefparam preloadbars =10000DEFPARAM CumulateOrders = true // Cumulating positions deactivatedCOI= WEIGHTEDAVERAGE[70](ROC[55] +ROC[50])MAC= MACDline[180,390,135]CCC= CCI [20]AAA= ADX [14]once RRreached = 0accountbalance = 10000 //account balance in money at strategy startriskpercent = 1 //whole account risk in percent%amount = 1 //lot amount to open each traderr = 2 //risk reward ratio (set to 0 disable this function)sd = 0.25 //standard deviation of MA floating profit//dynamic step gridminSTEP = 10 //minimal step of the gridmaxSTEP = 50 //maximal step of the gridATRcurrentPeriod = 60 //recent volatility 'instant' periodATRhistoPeriod = 600 //historical volatility periodATR = averagetruerange[ATRcurrentPeriod]histoATR= highest[ATRhistoPeriod](ATR)resultMAX = MAX(minSTEP*pipsize,histoATR - ATR)resultMIN = MIN(resultMAX,maxSTEP*pipsize)gridstep = (resultMIN)// Conditions to enter long positionsc1 = (COI > COI[5])c2 = (MAC > MAC[5])c3 = (CCC CROSSES OVER 0)c4 = (AAA > AAA[5])c5 = (AAA > 20)//first trade whatever conditionif NOT ONMARKET AND HIGHEST[5](c1)=1 AND HIGHEST[5](c2)=1 AND HIGHEST[5](c3)=1 AND HIGHEST[5](c4)=1 AND HIGHEST[5](c5)=1 AND STRATEGYPROFIT=0 then //close>close[1]BUY amount LOT AT MARKETendif// case BUY - add orders on the same trendif longonmarket and close-tradeprice(1)>=gridstep thenBUY amount LOT AT MARKETendif//money managementliveaccountbalance = accountbalance+strategyprofitmoneyrisk = (liveaccountbalance*(riskpercent/100))if onmarket thenonepointvaluebasket = pointvalue*countofpositionmindistancetoclose =(moneyrisk/onepointvaluebasket)*pipsizeendif//floating profitfloatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize//actual trade gainsMAfloatingprofit = average[100](floatingprofit)BBfloatingprofit = MAfloatingprofit - std[100](MAfloatingprofit)*sd//floating profit risk reward checkif rr>0 and floatingprofit>moneyrisk*rr thenRRreached=1endif//stoploss trigger when risk reward ratio is not met alreadyif onmarket and RRreached=0 thenSELL AT positionprice-mindistancetoclose STOPendif//stoploss trigger when risk reward ratio has been reachedif onmarket and RRreached=1 thenif floatingprofit crosses under BBfloatingprofit thenSELL AT MARKETendifendif//resetting the risk reward reached variableif not onmarket thenRRreached = 0endifShort;
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182/// Definition of code parametersdefparam preloadbars =10000DEFPARAM CumulateOrders = true // Cumulating positions deactivatedCOI= WEIGHTEDAVERAGE[70](ROC[55] +ROC[50])MAC= MACDline[180,390,135]CCC= CCI [20]AAA= ADX [14]once RRreached = 0accountbalance = 10000 //account balance in money at strategy startriskpercent = 1 //whole account risk in percent%amount = 1 //lot amount to open each traderr = 2 //risk reward ratio (set to 0 disable this function)sd = 0.25 //standard deviation of MA floating profit//dynamic step gridminSTEP = 10 //minimal step of the gridmaxSTEP = 50 //maximal step of the gridATRcurrentPeriod = 60 //recent volatility 'instant' periodATRhistoPeriod = 600 //historical volatility periodATR = averagetruerange[ATRcurrentPeriod]histoATR= highest[ATRhistoPeriod](ATR)resultMAX = MAX(minSTEP*pipsize,histoATR - ATR)resultMIN = MIN(resultMAX,maxSTEP*pipsize)gridstep = (resultMIN)// Conditions to enter short positionsc11 = (COI < COI[5])c12 = (MAC < MAC[5])c13 = (CCC CROSSES UNDER 0)c14 = (AAA > AAA[5])c15 = (AAA > 20)//first trade whatever conditionif NOT ONMARKET AND HIGHEST[5](c11)=1 AND HIGHEST[5](c12)=1 AND HIGHEST[5](c13)=1 AND HIGHEST[5](c14)=1 AND HIGHEST[5](c15)=1 AND STRATEGYPROFIT=0 then //close<close[1]SELLSHORT amount LOT AT MARKETendif// case SELL - add orders on the same trendif shortonmarket and tradeprice(1)-close>=gridstep thenSELLSHORT amount LOT AT MARKETendif//money managementliveaccountbalance = accountbalance+strategyprofitmoneyrisk = (liveaccountbalance*(riskpercent/100))if onmarket thenonepointvaluebasket = pointvalue*countofpositionmindistancetoclose =(moneyrisk/onepointvaluebasket)*pipsizeendif//floating profitfloatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize//actual trade gainsMAfloatingprofit = average[40](floatingprofit)BBfloatingprofit = MAfloatingprofit - std[40](MAfloatingprofit)*sd//floating profit risk reward checkif rr>0 and floatingprofit>moneyrisk*rr thenRRreached=1endif//stoploss trigger when risk reward ratio is not met alreadyif onmarket and RRreached=0 thenEXITSHORT AT positionprice-mindistancetoclose STOPendif//stoploss trigger when risk reward ratio has been reachedif onmarket and RRreached=1 thenif floatingprofit crosses under BBfloatingprofit thenEXITSHORT AT MARKETendifendif//resetting the risk reward reached variableif not onmarket thenRRreached = 0endifI’m looking forward to feedback to fix the code.
11/02/2016 at 7:21 PM #15877Hi Elsborg,
Sorry I didn’t answer all your questions last time around. Your assumptions of the entry criteria are correct, though I would like to say that 20 is a sufficient ADX (14) value, there is a fair amount of discretion to my trading method but you covered most of it. For the higher timeframe screening only one higher TF is a valid signal but if I decide to start the system based on M15 I like to see two or three indicators agreeing on H1.
I have been testing your indicator and it looks very promising, it would be great if are able to implement the CCI crossing too since that is our trigger while the other indicators are filters. In addition I am thinking that since the Coppock sometimes start turning only to turn back we should implement a moving average on the Coppock in the same way as it used on the MACD, do you think you are able to code it? That would be great 🙂
Furthermore I have noticed that my lack of coding skills has once again tricked me, since posting the modified code based on Mike’s Trend Chaser 3.0 with entry conditions I have been confused about MACD and MACDline in the code, it should be MACD to be above or below zero not MACDline, I will look to post new and revised code this weekend.
BTW the long setup in DAX H1 which I posted stayed a setup and never gave a signal an no entry has been taken yet.
1 user thanked author for this post.
11/03/2016 at 8:51 PM #15944Hi CFTA. no worries I’ve been busy with trying to do some automated strategy for the grid order- executed on 10 and 2 sec. very profitable in backtest but not worth betting money on, based on 3 days of demotrading. never mind this- I will continue and get back when I have something more solid.
I have also tried your modified new code and get the idea. Wait for entry signals on larger TF and let it run one time to open position automatic on a smaller TF. I took the idea and replaced you indicators with the original ones- mainly because this was where I was in the process. I tried to set up both- side by side, and just run try-out on different- but matching time frames, side by side to see the difference. Nothing conclusive because it would take some more controlled test- however I felt that the original indicator setup was more profitable on lower TF.
Anyway the Indicator should be straight forward. I have added the CCI crossing. If we can get this right we can make the Screener thereafter
About the Coppock. It’s a bit tricky as it’s not an indicator in the standard library of PRT, so we need to create it ourself. luckily I search custom Libary and the calculation was there to reuse. I played around with it but was not satisfied so I made it an EMA version. It far from fancy and it takes a bit time to modify for different periods. I could have been great to be able to code the periods in window-selection so it would be automated- however I don’t know if this is possible or maybe there would be some other trick to do this, so one don’t need to adjust the code manually. it will make sense when you see the code. I made a CoppockEMA-34. you can try and play around with it. Also if anyone has some comments on this or other smarter idea, it would be welcome 🙂 If you see an idea or how we could add the Coppock or the coppockEMA-34 to the indicator let me know.
Cheers Kasper
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950//***************LongHistogram1 = MACD[12,26,9](close)//HistogramBlue1 = MACDline[12,26,9](close)//Blue linered1 = ExponentialAverage[9](MACDline[12,26,9](close))//RED LineADX1 = ADX[14]c1 = (blue1 CROSSES OVER red1)c11 = Blue1<0c2 = (Histogram1 CROSSES OVER 0)c4 = (ADX1 > 25)Mycci1= CCI[12]c44 =Mycci1[1]<0 and Mycci1[0]>0indicator2 = CALL "MGC-Coppock"[14, 11, 10](close)c12 = (indicator2 > indicator2[1])If c1 and c2 and c12 and c4 and c11 and c44 thenIndicator1=1ElseIndicator1=0Endif//*************ShortHistogram2 = MACD[12,26,9](close)//HistogramBlue2 = MACDline[12,26,9](close)//Blue linered2 = ExponentialAverage[9](MACDline[12,26,9](close))//RED LineADX2 = ADX[14]c22 = (blue2 CROSSES Under red2)c21 = Blue2>0c222 = (Histogram2 CROSSES under 0)c242 = (ADX2 > 25)Mycci2= CCI[12]c54 =Mycci2[1]>0 and Mycci2[0]<0indicator2 = CALL "MGC-Coppock"[14, 11, 10](close)c122 = (indicator2 < indicator2[1])If c22 and c21 and c122 and c242 and c222 and c54 thenIndicator22=-1ElseIndicator22=0EndifReturn indicator1 COLOURED(0,255,0) as "Buy", indicator22 COLOURED(255,0,0) as "Sell"1 user thanked author for this post.
11/03/2016 at 9:13 PM #15949Thanks great stuff Kasper, I’ll start testing it tomorrow 🙂
We need to give the Coppock some thought, it is a useful indicator but not being a standard PRT indicator makes it more diffucult to deal with, in addition it may repaint, I have been thinking about replacing it with another indicator or having two sets of MACD set at values equivalent to different TFs but that is just a thought for now…
BTW does the dynamic grid step work as intended for you with larger steps during low volatility? It seem all my entries are taken at the min grid step distance regardless of values, I also tried the indicator for it which Nicolas posted a couple of pages back and the indicator to show the min step almost all the time regardless of settings and market conditions.
Looking forward to hearing more about the automated strategy once it is ready 🙂
-
AuthorPosts
Find exclusive trading pro-tools on