• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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:

    https://ninjatrader.com/support/help...riceseries.htm
    https://ninjatrader.com/support/help...timeseries.htm
    https://ninjatrader.com/support/help...lumeseries.htm

    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.
    https://ninjatrader.com/support/help...script_cod.htm

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by TazoTodua, Today, 03:01 PM
    2 responses
    5 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Mykro, Today, 02:16 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by tonynt, Today, 02:06 PM
    3 responses
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by itrader46, Today, 01:53 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by maindoor, Today, 01:06 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Working...
    X