Stochastic MACD – DJI 1H
Forums › ProRealTime English forum › ProOrder support › Stochastic MACD – DJI 1H
- This topic has 12 replies, 4 voices, and was last updated 6 years ago by Nicolas.
Tagged: Dow Jones, Macd, Stochastic
-
-
09/15/2018 at 11:00 AM #80552
I developed / expanded on Roberto code from link below.
Which Equity Curve / Performance (v1.o, v1.1 or v 1.2) would you set going on Live and why … easy / friendly bit of weekend discussion? 🙂
https://www.prorealcode.com/topic/macd-stochastic-code/#post-76115
1 user thanked author for this post.
09/15/2018 at 11:22 AM #80561I’d go for version 1.2, since it has the lowest drawdown still having a fairly good gain.
What scares me a bit is that the max consecutive number of losses outperforms max consecutive wins in ALL cases!
Did you demo it for some time?
1 user thanked author for this post.
09/15/2018 at 12:40 PM #80568Did you demo it for some time?
No I just knocked them up while eating my breakfast this morning! 🙂 I’ll work on them more.
If anybody wants the code as a basis for further development together then just shout up … I enjoy a bit of collaboration and light-hearted discussion! 🙂
09/15/2018 at 1:20 PM #8057009/15/2018 at 2:19 PM #80573I agree with Vonasi.
09/15/2018 at 8:25 PM #80600Thanks Guys, sorry for delay … been on my daughter’s house extension since this morning!
Below are the results over 100k bars with spread = 4 (spread = 4 was also used on the 10k screen shots above.
I will post the code and the .itf in a separate post (with opto settings) for each version.
This will be child’s play for you two guys to improve the results!? 🙂
09/15/2018 at 8:28 PM #80605Version 1.0
1234567891011121314151617DEFPARAM CUMULATEORDERS = FalsestocK = Stochastic[14,3](close)StocD = Average[5](StocK)MacdVal = Macd[12,26,9](close)Up1 = StocK CROSSES OVER StocDUp2 = MacdVal > 0Dn1 = StocK CROSSES UNDER StocDDn2 = MacdVal < 0IF Up1 and Up2 THENBuy 1 contract at marketEndIfIf Dn1 and Dn2 ThenSell at MarketEndif09/15/2018 at 8:30 PM #80607Version 1.1
123456789101112131415161718192021222324252627282930313233343536373839404142DEFPARAM CUMULATEORDERS = FalsestocK = Stochastic[14,3](close)StocD = Average[5](StocK)MacdVal = Macd[12,26,9](close)Up1 = StocK CROSSES OVER StocDUp2 = MacdVal > 0Up3 = stocK > A8Dn1 = StocK CROSSES UNDER StocDDn2 = MacdVal < 0Dn3 = stocK < A12//GO LONGIF Up1 and Up2 and Up3 THENBuy 1 contract at marketEndIf//EXIT LONGIf Dn1 and Dn2 ThenSell at MarketEndif//Go SHORTIf Dn1 and Dn2 and Dn3 ThenSellShort at marketEndif//EXIT SHORT//If Up3 Then//ExitShort at market//Endif//If Longonmarket Then//SET TARGET PPROFIT A35//SET STOP PLOSS A36//Endif////If Shortonmarket Then//SET TARGET PPROFIT A40//SET STOP PLOSS A41//Endif09/15/2018 at 8:42 PM #80609Version 1.2
(I’ve got one eye on the TV so if I upload a ‘mistake’ then please let me know).
123456789101112131415161718192021222324252627282930313233343536373839404142DEFPARAM CUMULATEORDERS = FalsestocK = Stochastic[14,3](close)StocD = Average[5](StocK)MacdVal = Macd[12,26,9](close)Up1 = StocK CROSSES OVER StocDUp2 = MacdVal > 0Up3 = stocK > A8Dn1 = StocK CROSSES UNDER StocDDn2 = MacdVal < 0Dn3 = stocK < A12//GO LONGIF Up1 and Up2 and Up3 THENBuy 1 contract at marketEndIf//EXIT LONGIf Dn1 and Dn2 ThenSell at MarketEndif//Go SHORTIf Dn1 and Dn2 and Dn3 ThenSellShort at marketEndif//EXIT SHORT//If Up3 Then//ExitShort at market//EndifIf Longonmarket ThenSET TARGET PPROFIT A35SET STOP PLOSS A36EndifIf Shortonmarket ThenSET TARGET PPROFIT A40SET STOP PLOSS A41Endif09/16/2018 at 7:57 AM #8061409/16/2018 at 8:30 AM #80615For what my opinion is worth…. when I see optimized stop loss and take profit levels my brain screams ‘curve fit’ so v1.2 is the worst for me.
v1.2 and v1.1 both short on the DJI which I would never do as the strategy would be swimming against the tide. Shorting would be OK if we had identified that we were in a major recession – the news is the best indicator of this!
The addition of optimized levels for Up3 and Dn3 conditions adds one more level of curve fitting but as the equity curve on v1.0 is so poor we need something to improve the strategy!
Have you tried the v1.0 with just the Up3 condition added and optimized?
Maybe using MTF in a slower time frame to identify good days to enter might be an improvement by testing whether it is a strategy that is better when buying in dips or when buying in trends.
1 user thanked author for this post.
09/16/2018 at 10:02 AM #80619Re suggestions made on this Thread … if anybody wants to code them up into a System then feel free.
Please then increment the version number and post on here …
- Old and new version Equity Curve.
- Old and new Performance stats.
- New version code.
Thank You
GraHal09/17/2018 at 8:39 AM #80663Use stochastic to buy the dip and sell the top is the best idea, but what happen when the indicator desync from price is a common problem 😐 Dynamic/adaptive period calculation could be something interesting to test here. There are many different ways to adapt period, one example for stochastic: John Ehlers Adaptive Stochastic
1 user thanked author for this post.
-
AuthorPosts