With help from Vonasi (many many thanks) I developed an indicator which shows higher lows and lower highs in the MACD in sync with higher lows from bars which cross the Averge line. You are able set your personal Average and personal MACD.
In the image you see an example of lower highs in sync.
DEFPARAM calculateonlastbars = 1000
macdl = macdline[ShortTermMA,LongTermMA,Periods]
macds = exponentialaverage[Periods](macdl)
//start of cycle low
If macdl =< macds and macdl[1] > macds[1] then
macdlowest2 = macdlowest
lowestprice2 = lowestprice
incyclelow = 1
macdlowest = macdl
LowestPrice = low
endif
//End of cycle low
If macdl > macds and macdl[1] < macds[1] or macdl < macdlowest2 then
incyclelow = 0
endif
//lowest macd and price in cycle
if incyclelow then
macdlowest = min(macdlowest, macdl)
lowestPrice = min(lowestprice, low)
c1 = open < average[ma]
c2 = close > average[ma]
c3 = macdlowest > macdlowest2
c4 = lowestprice > lowestprice2
if c1 and c2 and c3 and c4 then
drawvline(barindex)coloured(0,250,0)
endif
endif
//start of cycle high
If macdl => macds and macdl[1] < macds[1] then
macdhighest2 = macdhighest
highestprice2 = highestprice
incyclehigh = 1
macdhighest = macdl
highestPrice = high
endif
//End of cycle high
If macdl < macds and macdl[1] > macds[1] or macdl > macdhighest2 then
incyclehigh = 0
endif
//highest macd and price in cycle high
if incyclehigh then
macdhighest = min(macdhighest, macdl)
highestPrice = min(highestprice, low)
c1a = open > average[ma]
c2a = close < average[ma]
c3a = macdhighest < macdhighest2
c4a = highestprice < highestprice2
if c1a and c2a and c3a and c4a then
drawvline(barindex)coloured(250,0,0)
endif
endif
return
An image of the actual indicator on a chart might be helpful.
I found one error, so here the fresh one.
DEFPARAM calculateonlastbars = 1000
macdl = macdline[ShortTermMA,LongTermMA,Periods]
macds = exponentialaverage[Periods](macdl)
//start of cycle low
If macdl =< macds and macdl[1] > macds[1] then
macdlowest2 = macdlowest
lowestprice2 = lowestprice
incyclelow = 1
macdlowest = macdl
LowestPrice = low
endif
//End of cycle low
If macdl > macds and macdl[1] < macds[1] or macdl < macdlowest2 then
incyclelow = 0
endif
//lowest macd and price in cycle
if incyclelow then
macdlowest = min(macdlowest, macdl)
lowestPrice = min(lowestprice, low)
c1 = open < average[ma]
c2 = close > average[ma]
c3 = macdlowest > macdlowest2
c4 = lowestprice > lowestprice2
if c1 and c2 and c3 and c4 then
drawvline(barindex)coloured(0,250,0)
endif
endif
//start of cycle high
If macdl => macds and macdl[1] < macds[1] then
macdhighest2 = macdhighest
highestprice2 = highestprice
incyclehigh = 1
macdhighest = macdl
highestPrice = high
endif
//End of cycle high
If macdl < macds and macdl[1] > macds[1] or macdl > macdhighest2 then
incyclehigh = 0
endif
//highest macd and price in cycle high
if incyclehigh then
macdhighest = max(macdhighest, macdl)
highestPrice = max(highestprice, high)
c1a = open > average[ma]
c2a = close < average[ma]
c3a = macdhighest < macdhighest2
c4a = highestprice < highestprice2
if c1a and c2a and c3a and c4a then
drawvline(barindex)coloured(250,0,0)
endif
endif
How do you use it please? People would love to know! (and me too) 😉
Hi Nicolas,
It could be a way enter positions. Of course it is an indicator which only indicates, but it in a trending market it could be a way to enter positions. As you see in example in the image it indicates a possibility to go long.
If you need higher probability you it would be good to combine it with your favourite indicators.