Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Convert Pine script to Ninja Script

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

    Convert Pine script to Ninja Script

    Hi - I need some assistance in converting the pine script to ninja script. Could you please here? Here is the pine script code link.. I am trying to calculate smooth range in ninja script for the below pine script.

    Pine Script: Line 29 to 35.
    Range Filter Buy and Sell 5min - the @guikroth version, republished. Since this popular version of the Range Filter is no longer available via the original author, I republish it here under the same name. This version remains true to the guikroth version from the calculations to the default settings and comments in the code, with the exception of an update to the latest version of PineScript, minor styling adjustments and the addition of an all-in-one 'buy or sell' alert option. The guikroth …

    ​​
    how to calculate exponential average of close price differences in Ninjatrader8
    // Smooth Average Range
    smoothrng(x, t, m) =>
    wper = t * 2 - 1
    avrng = ta.ema(math.abs(x - x[1]), t)
    smoothrng = ta.ema(avrng, wper) * m
    smoothrng
    smrng = smoothrng(src, per, mult)​

    #2
    Hello sk2013,

    Thanks for your post.

    EMA() could be used to calculate the Exponential Moving Average section of the code you shared.

    EMA(): https://ninjatrader.com/support/help...onential_e.htm

    Math.Abs() is the C# method to calculate absolute value in C#. You could do a quick Google search for 'Math.Abs C#' for more information about that C# method.

    Below is a link to a forum post with helpful information about getting started with NinjaScript.
    https://ninjatrader.com/support/foru...040#post786040

    Please note that in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services in our support. This is so that we can maintain a high level of service for all of our clients as well as our partners.

    This forum thread will be open for other community members to share their insights on the topic.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Jonafare, 12-06-2012, 03:48 PM
    5 responses
    3,985 views
    0 likes
    Last Post rene69851  
    Started by Fitspressorest, Today, 01:38 PM
    0 responses
    2 views
    0 likes
    Last Post Fitspressorest  
    Started by Jonker, Today, 01:19 PM
    0 responses
    2 views
    0 likes
    Last Post Jonker
    by Jonker
     
    Started by futtrader, Today, 01:16 PM
    0 responses
    8 views
    0 likes
    Last Post futtrader  
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,792 views
    0 likes
    Last Post aligator  
    Working...
    X