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 WHICKED, Today, 12:56 PM
    2 responses
    15 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Felix Reichert, Today, 02:12 PM
    0 responses
    1 view
    0 likes
    Last Post Felix Reichert  
    Started by Tim-c, Today, 02:10 PM
    0 responses
    1 view
    0 likes
    Last Post Tim-c
    by Tim-c
     
    Started by cre8able, Today, 01:16 PM
    2 responses
    9 views
    0 likes
    Last Post cre8able  
    Started by chbruno, 04-24-2024, 04:10 PM
    3 responses
    49 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X