Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Anyone can code this in Ninja trader

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Anyone can code this in Ninja trader

    Hi
    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

    #2
    Mike,

    You will need to get this converted into a NinjaScript indicator.

    To color the bar you can use the code BarColor. http://www.ninjatrader-support.com/H.../BarColor.html

    If you are not a programmer and would like this professionally done you may also want to consider one of these 3rd party NinjaScript Consultants: http://www.ninjatrader.com/webnew/pa...injaScript.htm
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    49 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    141 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    275 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X