MACD Multiplier

Created at 06 Jul 2017, 06:03
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
Hanesher's avatar

Hanesher

Joined 30.06.2017

MACD Multiplier
06 Jul 2017, 06:03


Hi can someone help me convert this MACD Multiplier pine script to C#

 

Cheers

Jo

study(shorttitle = "", title = "", precision = 5)  //decimal
//Option-1: Multiplier can be an integer
factor = input(title="", type = float, defval = 1.0, minval = 0.5,step=0.5)

fastMA = round(12*factor)
slowMA = round(26*factor)

//Histogram styles
lastColor = yellow
[currMacd,_,_] = macd(close[0], fastMA, slowMA, 9)
[prevMacd,_,_] = macd(close[1], fastMA, slowMA, 9)
plotColor = currMacd > 0
 ? currMacd > prevMacd ? #73EF2B : #469916
 : currMacd < prevMacd ? #D11515 : #FF4343
plot(currMacd, style = histogram, color = plotColor, linewidth = 3)
plot(0, title = "", linewidth = 1, color = gray)
//Crossover Markers
upCross = currMacd > 0 and prevMacd < 0
downCross = currMacd < 0 and prevMacd > 0
plotshape(upCross, style = shape.labelup, color = #73EF2B , location = location.bottom)
plotshape(downCross, style = shape.labeldown, color = #D11515 , location = location.top)

 


@Hanesher