😆 ok, more seriously, I’ll try to fix it tomorrow.
😉 sorry again to bother you.. promise that will be the last thing i ask you on this!!! thanks in advance
Here is the code and commented, I’m sure you’ll find easily where to change color depending of the conditions of where is the curve:
// --- settings
eintPeriod = 20
edblHigh1 = 0.04
edblLow1 = -0.04
atrPeriod = 100
// --- end of settings
atr = AverageTrueRange[atrPeriod](close)
dblTma = TriangularAverage[eintPeriod](close)
if barindex>eintPeriod then
dblPrev = dblTma[1]
gadblSlope = ( dblTma - dblPrev ) / atr
//BUY ONLY
if ( gadblSlope[0] > edblHigh1 ) then //above the higher line
if(close < open) then
drawcandle(open,high,low,close)coloured(0,128,0) //light blue
else
drawcandle(open,high,low,close)coloured(0,255,0) //dark blue
endif
//SELL ONLY
elsif ( gadblSlope[0] < edblLow1 ) then //below the lower line
if(close < open) then
drawcandle(open,high,low,close)coloured(255,0,0) //light red
else
drawcandle(open,high,low,close)coloured(178,34,34) //dark red
endif
else //ranging between the 2 lines
if(gadblSlope[0] < gadblSlope[1]) then
drawcandle(open,high,low,close)coloured(255,105,180) //curve is declining
else
drawcandle(open,high,low,close)coloured(128,128,128) //curve is ascending
endif
endif
endif
return
Sorry but i’m still struggling to understand what you need exactly about the colors 🙂
sorry im confusing you.. this great as it is and now more clear!! it just last two in the code //the ranging between the 2 lines.
lets say
if(gadblSlope[0] < gadblSlope[1]) then
drawcandle(open,high,low,close)coloured(255,105,180) //curve is declining (Pink to go Dark pink if close < open)
and
drawcandle(open,high,low,close)coloured(128,128,128) //curve is ascending (grey to go dark grey if close > open)
sorry again for complicating…. i think happy with you created already!! thank you nicolas
Hopefully this new code will be the good one!! 😆
// --- settings
eintPeriod = 20
edblHigh1 = 0.04
edblLow1 = -0.04
atrPeriod = 100
// --- end of settings
atr = AverageTrueRange[atrPeriod](close)
dblTma = TriangularAverage[eintPeriod](close)
if barindex>eintPeriod then
dblPrev = dblTma[1]
gadblSlope = ( dblTma - dblPrev ) / atr
//BUY ONLY
if ( gadblSlope[0] > edblHigh1 ) then //above the higher line
if(close < open) then
drawcandle(open,high,low,close)coloured(0,128,0) //light blue
else
drawcandle(open,high,low,close)coloured(0,255,0) //dark blue
endif
//SELL ONLY
elsif ( gadblSlope[0] < edblLow1 ) then //below the lower line
if(close < open) then
drawcandle(open,high,low,close)coloured(255,0,0) //light red
else
drawcandle(open,high,low,close)coloured(178,34,34) //dark red
endif
else //ranging between the 2 lines
if(gadblSlope[0] < gadblSlope[1]) then
if close>open then
drawcandle(open,high,low,close)coloured(255,105,180) //curve is declining and close>open
else
drawcandle(open,high,low,close)coloured(139,58,98) //curve is declining and close<open
endif
else
if close<open then
drawcandle(open,high,low,close)coloured(128,128,128) //curve is ascending and close<open
else
drawcandle(open,high,low,close)coloured(66,66,66) //curve is ascending and close>open
endif
endif
endif
endif
return
Wow… This exactly what i was trying to explain!!! thanks a million Nicolas.. this can be really used as a trading system!! need to change numbers and try!! thank you again!!