Plot a graph as indicator

Hello guys, I want to plot a graph as indicator with following conditions in amibroker.

1) Price of candles should b a line. [5 min timeframe]
2) Line2 should be above [with small gap] price line which will b green if Stochastic[15 min] is +ve , else Red. This line wont contain the actual value of stochastic just only +ve/-ve so it should be perfect horizontal line which do not move up/down on scrolling like price line.
3) Line 3 same as Line2 but for macd [15 min] below the price line.
Plz Help

_SECTION_BEGIN("Neotrade");
n=Param("TM",1,1,60,1);
n_open = TimeFrameGetPrice("O",n*in1Minute);
n_high = TimeFrameGetPrice("H",n*in1Minute);
n_low = TimeFrameGetPrice("L",n*in1Minute);
n_close = TimeFrameGetPrice("C",n*in1Minute);
 
n_Open = TimeFrameCompress( n_Open, n*in1Minute );
n_High = TimeFrameCompress( n_High, n*in1Minute );
n_Low = TimeFrameCompress( n_Low, n*in1Minute );
n_Close = TimeFrameCompress( n_Close, n*in1Minute );

TimeFrameSet(n);
LookBack = Param("Lookback", 13, 2, 100 );
Smooth1 = Param("Smooth 1", 25, 1, 100 );
Smooth2 = Param("Smooth 2", 2, 1, 100 );

HH = HHV( n_High, LookBack );
LL = LLV( n_Low, LookBack );

StoMom = 100 * EMA( EMA( n_Close - 0.5 * ( HH + LL ), Smooth1 ), Smooth2 ) / 
( 0.5 * EMA( EMA( HH - LL, Smooth1 ), Smooth2 ) );

r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );

ml = MACD(r1, r2);
TimeFrameRestore(); 

//Plot(StoMom, _DEFAULT_NAME(), ParamColor("Color", ColorCycle ),styleline );

Plot( C, "Close", ParamColor("Color", colorDefault ), styleline);

prev_C = Ref(Close, -1);

stok_line = prev_C +  (prev_C*0.01);
MACD_line = prev_C - (prev_C*0.01);

Plot(stok_line, _DEFAULT_NAME(), IIf(StoMom > 0,colorGreen, colorRed), styleLine);
 Plot(MACD_line, _DEFAULT_NAME(), IIf(ml > 0,colorGreen, colorRed), styleLine);
_SECTION_END();

Please set the parameter TM which will be period value as per your requirement. Let me know if it satisfies your requirement or any update on top of this code.

Regards

Vivith

www.neotradeanalytics.com

(Authorized vendor of NSE supporting realtime data feeds to Amibroker,Metastock and Ninjatrader)

You want it to be plotted in Amibroker? AFL?

Yes n it is written in 1st line.