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 rocketman7, Today, 02:12 AM
    5 responses
    23 views
    0 likes
    Last Post rocketman7  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    7 responses
    28 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by samish18, 04-17-2024, 08:57 AM
    17 responses
    66 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by briansaul, Today, 05:31 AM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by PaulMohn, Today, 03:49 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X