Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help converting Ind to Ninjatrader C#

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

    Help converting Ind to Ninjatrader C#

    Hi all, i have a simple task, wanna convert this snippet of code to Ninja:

    eachpoint = volume * ((close - nz(close[1]))/(high-low) )

    allpoints = cum(eachpoint)


    its a TradingView indicator, a mix of OBV and ADL, i been calling them separately then adding and dividing by two, but the result doesn't seem to be the same, perhaps volume isnt the same? anyways, thought asking for some help doesn't hurt, seems pretty easy and it would clear up my existencial doubt


    Thanksss!

    #2
    Hello kabott,

    Thank you for the post.

    To start I believe it would be helpful to post some links where you can find information about the items you posted:





    These are the standard Series for data access, in what you provided you will need to use a few of these series.

    For what you have, the series could be used like the following:

    Code:
    double eachpoint = Volume[0] * ((Close[0]- nz(Close[1]))/(High[0]-Low[0]) )
    As I am unsure what the NZ is in this case, you will likely need to review what that indicator is doing to proceed there. In NinjaTrader you would call an indicator similar to this, depending on the use case it may be written as follows:

    Code:
    NZ(Close)[0]
    or the format of:
    Code:
    IndicatorName(OptionalInputSeries, Paramaters)[BarsAgo] or IndicatorName(OptionalInputSeries, Paramaters).PlotName[BarsAgo]

    Assuming this is an indicator which takes a double parameter:

    Code:
    double allpoints = cum(eachpoint)[0];

    I would likely suggest to use output/prints in the tradingview script you are working with to output the volume/prices/calculated values over a very short set of data. This will give you some hard values to compare in NinjaTrader when converting it. You are likely going to see some differences between how these two platforms process so prints will be helpful to identify that.


    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    599 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    344 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    558 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    557 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X