Help with Higher Lows Price sync with Higher Low MACD when candle crosses MA
Forums › ProRealTime English forum › ProBuilder support › Help with Higher Lows Price sync with Higher Low MACD when candle crosses MA
- This topic has 72 replies, 3 voices, and was last updated 5 years ago by GraHal.
-
-
09/11/2019 at 9:45 PM #107284
The code looks fine. I didn’t see any errors when I tested this version which has standard MACD settings and 50 period average and simply returns a flag value. It all looked just fine along side a MACD and price chart. Are you sure that you are comparing the same MACD settings in the indicator compared to any separate MACD indicator that you are looking at?
123456789101112131415161718192021222324252627282930313233343536//DEFPARAM calculateonlastbars = 1000macdl = macdline[12,26,9]macds = exponentialaverage[9](macdl)//start of cycle highIf macdl => macds and macdl[1] < macds[1] thenmacdhighest2 = macdhighesthighestprice2 = highestpriceincyclehigh = 1macdhighest = macdlHighestPrice = highendif//End of cycle highIf macdl < macds and macdl[1] > macds[1] thenincyclehigh = 0endif//highest macd and price in cycle highif incyclehigh thenmacdhighest = max(macdhighest, macdl)highestPrice = max(highestprice, high)c1 = open > average[50]c2 = close < average[50]c3 = macdhighest < macdhighest2c4 = highestprice < highestprice2endifflag = 0if c1 and c2 and c3 and c4 thenflag = 1endifreturn flag09/11/2019 at 10:32 PM #107291I am looking at E-mini Russell, 200 ticks.
This is a chart from today, from 20:20 untill 22:00
I use sma 20 in the chart and I have that programmed as a fixed number, so not as and indicator parameter.
I have a MACD_Vonasi_LOWS, your MACD and I made the MACD-Vonasi_highs out of that. You see both seperate in the chart. I use MACD[2,20,30]. This is also in the code for the cycle lows and highs.I Have included the Cycle Low and the Cycle Hig Indicator.
SEE THE IMAGE FOR THE FALL OUTS
CYCLE LOW MACD and PRICE INDICATOR1234567891011121314151617181920212223242526272829303132333435363738394041424344454647//---CYCLE LOW MACD and PRICE INDICATORDEFPARAM calculateonlastbars = 1000macdl = macdline[5,20,30]macds = exponentialaverage[30](macdl)//start of cycle lowIf macdl =< macds and macdl[1] > macds[1] thenmacdlowest2 = macdlowestlowestprice2 = lowestpriceincyclelow = 1macdlowest = macdlLowestPrice = lowendif//End of cycle lowIf macdl > macds and macdl[1] < macds[1] thenincyclelow = 0endif//lowest macd and price in cycleif incyclelow thenmacdlowest = min(macdlowest, macdl)lowestPrice = min(lowestprice, low)c1 = open < average[20]c2 = close > average[20]c3 = macdlowest > macdlowest2c4 = lowestprice > lowestprice2if c1 and c2 and c3 and c4 thenDRAWSEGMENT (barindex, close+target1, barindex, close+target3)COLOURED(0,250,0)DRAWSEGMENT (barindex, close+target1, barindex+1, close+target1)COLOURED(0,250,0)DRAWTEXT("TA1", barindex-1, close+target1, Dialog, Standard, 10) COLOURED(0,0,0)DRAWSEGMENT (barindex, close+target2, barindex+1, close+target2)COLOURED(0,250,0)DRAWTEXT("TA2", barindex-1, close+target2, Dialog, Standard, 10) COLOURED(0,0,0)DRAWSEGMENT (barindex, close+target3, barindex+1, close+target3)COLOURED(0,250,0)DRAWTEXT("TA3", barindex-1, close+target3, Dialog, Standard, 10) COLOURED(0,0,0)DRAWSEGMENT (barindex, close-stoploss, barindex+1, close-stoploss)COLOURED(250,0,100)DRAWSEGMENT (barindex, close-(stoploss-0.25), barindex, close-stoploss)COLOURED(250,0,100)DRAWTEXT("SL", barindex-1, close-stoploss, Dialog, Standard, 10) COLOURED(0,0,0)DRAWTEXT("F1", barindex, close+target3+0.75, Dialog, Standard, 14) COLOURED(0,250,0)endifendifreturnCYCLE HIGH MACD and PRICE INDICATOR1234567891011121314151617181920212223242526272829303132333435363738394041424344454647// CYCLE HIGH MACD and PRICE INDICATORDEFPARAM calculateonlastbars = 1000macdl = macdline[5,20,30]macds = exponentialaverage[30](macdl)//start of cycle highIf macdl => macds and macdl[1] < macds[1] thenmacdhighest2 = macdhighesthighestprice2 = highestpriceincyclehigh = 1macdhighest = macdlHighestPrice = highendif//End of cycle highIf macdl < macds and macdl[1] > macds[1] thenincyclehigh = 0endif//highest macd and price in cycle highif incyclehigh thenmacdhighest = max(macdhighest, macdl)highestPrice = max(highestprice, high)c1 = open > average[20]c2 = close < average[20]c3 = macdhighest < macdhighest2c4 = highestprice < highestprice2if c1 and c2 and c3 and c4 thenDRAWSEGMENT (barindex, close-target1, barindex, close-target3)COLOURED(0,250,0)DRAWSEGMENT (barindex, close-target1, barindex+1, close-target1)COLOURED(0,250,0)DRAWTEXT("TA1", barindex-1, close-target1, Dialog, Standard, 10) COLOURED(0,0,0)DRAWSEGMENT (barindex, close-target2, barindex+1, close-target2)COLOURED(0,250,0)DRAWTEXT("TA2", barindex-1, close-target2, Dialog, Standard, 10) COLOURED(0,0,0)DRAWSEGMENT (barindex, close-target3, barindex+1, close-target3)COLOURED(0,250,0)DRAWTEXT("TA3", barindex-1, close-target3, Dialog, Standard, 10) COLOURED(0,0,0)DRAWSEGMENT (barindex, close+stoploss, barindex+1, close+stoploss)COLOURED(250,0,100)DRAWSEGMENT (barindex, close+(stoploss-0.25), barindex, close+stoploss)COLOURED(250,0,100)DRAWTEXT("SL", barindex-1, close+stoploss, Dialog, Standard, 10) COLOURED(0,0,0)DRAWTEXT("LH", barindex, close-target3-0.75, Dialog, Standard, 14) COLOURED(250,0,0)endifendifreturn09/11/2019 at 10:47 PM #10729509/11/2019 at 11:32 PM #10729609/11/2019 at 11:33 PM #107297Hi again,
It looks like the fall outs are after a cycle low or high where the candle with the PriceHighest2 of the MacdHighest2 or PriceLowest2 of the MacdLowest2 are falling together.
When you look at the imag I included 2 posts before, you see only 1 line in a cycle in the MACD-Vonasi-Lows or MACD-Vonasi-Highs. That is where the they fall together.
After such a cycle the price and/or macd after that cycle don’t use it as a reference anymore.09/11/2019 at 11:42 PM #107299Read my answer before your last post.
I tested it with this code and on tick charts it shows the candle straddling the average when it isn’t. On time based charts everything works fine.
123456789101112131415161718192021222324252627282930313233343536//DEFPARAM calculateonlastbars = 1000macdl = macdline[5,20,30]macds = exponentialaverage[30](macdl)//start of cycle highIf macdl => macds and macdl[1] < macds[1] thenmacdhighest2 = macdhighesthighestprice2 = highestpriceincyclehigh = 1macdhighest = macdlHighestPrice = highendif//End of cycle highIf macdl < macds and macdl[1] > macds[1] thenincyclehigh = 0endif//highest macd and price in cycle highif incyclehigh thenmacdhighest = max(macdhighest, macdl)highestPrice = max(highestprice, high)c1 = open > average[20]c2 = close < average[20]c3 = macdhighest < macdhighest2c4 = highestprice < highestprice2endifflag = 0if c1 and c2 and c3 and c4 thenflag = 2endifreturn c1 as "open > ave",c2 as "close < ave",c3 as "lower macd",c4 as "lower price" , flag as "flag"09/11/2019 at 11:43 PM #10730009/11/2019 at 11:46 PM #107301You keep posting little tiny snippets of information without actually apparently reading the answers that have already been given to you. Please gather a reasonable amount of useful information together and then post it in one post rather than firing off a million snippets!
09/11/2019 at 11:50 PM #10730209/12/2019 at 12:09 AM #107305Hi Vonasi,
I am sorry for the amounts of posts. I will do my best to gather a reasanable amount of info.
On the other hand, when I am busy to decribe my post and to attach the right images and paste the righ coding, I cannot see that you have posted just a few minutes befor. The platform needs te be reloaded in the browser to see that. When I do that,everything have written for posting is gone. I read everything you have send immedeately when I see it.
But again I will do my best.09/12/2019 at 12:17 AM #10730609/12/2019 at 12:26 AM #107307Ah…that is good news for you. I know it is in the middle of the night for you. I am a night owl as well.
Thanks for all your time.
Sorry again for the many posts, I didn’t want to irritate you. I thought all was clear in the image of my 3rd post in the topic. But the indicator seemed harder then I expected. So therefor I sliced it in pieces.
Sleep well. I go to bed as well. 1:25 here and tomorrow I will be on the road.
Bye09/12/2019 at 10:51 AM #107344The platform needs te be reloaded in the browser to see that. When I do that,everything have written for posting is gone
A good idea would be to have 2 tabs open showing the same Thread and then you can type away your answer in one tab. but before you send … refresh the other tab to check for more recent postings etc. This way you will not lose what you have already typed.
I may try and follow my own advice … especially on fast moving Topics! 🙂
-
AuthorPosts
Find exclusive trading pro-tools on