I 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 INDICATOR
DEFPARAM calculateonlastbars = 1000
macdl = macdline[5,20,30]
macds = exponentialaverage[30](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] then
incyclelow = 0
endif
//lowest macd and price in cycle
if incyclelow then
macdlowest = min(macdlowest, macdl)
lowestPrice = min(lowestprice, low)
c1 = open < average[20]
c2 = close > average[20]
c3 = macdlowest > macdlowest2
c4 = lowestprice > lowestprice2
if c1 and c2 and c3 and c4 then
DRAWSEGMENT (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)
endif
endif
return
// CYCLE HIGH MACD and PRICE INDICATOR
DEFPARAM calculateonlastbars = 1000
macdl = macdline[5,20,30]
macds = exponentialaverage[30](macdl)
//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] then
incyclehigh = 0
endif
//highest macd and price in cycle high
if incyclehigh then
macdhighest = max(macdhighest, macdl)
highestPrice = max(highestprice, high)
c1 = open > average[20]
c2 = close < average[20]
c3 = macdhighest < macdhighest2
c4 = highestprice < highestprice2
if c1 and c2 and c3 and c4 then
DRAWSEGMENT (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)
endif
endif
return