I moving from trade station to Ninja and I have this tradestation code but I can't convert it to Ninja it is a paint bar and it is paint candlestick body and candle outline, anyone can help will be appriciated
Here the paintbar
inputs: Price( Close), Length(14) ;
if Price > AverageFC( Price, Length ) then
begin
PlotPaintBar( High, Low, "Pr>Avg" ) ;
Alert ;
end
else
NoPlot( 1 ) ; { unpaint the bar }
Here the function
inputs:
Price( numericseries ),
Length( numericsimple ) ; { this input is assumed to be a constant >= 1; will get
divide-by-zero error if Length = 0 }
AverageFC = SummationFC( Price, Length ) / Length ;
Here the other function
inputs:
Price( numericseries ),
Length( numericsimple ) ; { this input is assumed to be constant }
variables:
Sum( 0 ) ;
if CurrentBar = 1 then
begin
for Value1 = 0 to Length - 1
begin
Sum = Sum + Price[Value1] ;
end ;
end
else
Sum = Sum[1] + Price - Price[Length] ;
SummationFC = Sum ;
end
it is paint the bar blue if the price > then price Avg of 14 bar ago and paint the bar red if the price < then Price Avg of 14 bar ago.
Thanks
Mike
Comment