Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Print Slope Value

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

    Print Slope Value

    Hi,

    How can I get the slope of a given MA to print? Been struggling with this for a while.. So that I can re-use these printed values with the Slope and Numeric Value conditions.
    I understand that values will be completely different depending on the MA being used so its tricky to get an idea of scale when you want to create MA slope conditions.
    There are plenty of indicators that give MA slope values in degrees but this is not helpful for setting slope thresholds using Slope and Numeric Values.
    So how do I go about getting the numeric value of an MA slope, for slope condition building, to print?

    Thanks

    #2
    Hello Shadowshorter,

    You may print the values of the slope using the Print() statement and opening up the Output Window (In the Control Center -> Tools). For example:

    Code:
    Print("Slope of the SMA(20) = "+Slope(SMA(20), 10, 0));
    Here is a link to our Help Guide that you may view for another reference.
    JCNinjaTrader Customer Service

    Comment


      #3
      Thanks for your reply, works great. Can I add a time print too so that I know exactly which printed value refers which moment in time?

      Thanks

      Comment


        #4
        Hello Shadowshorter,

        Yes, you may use the "Time" object for this.

        Code:
        Print("Time of current bar is: "+Time[0]);
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        5 responses
        3,289 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        5 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        8 responses
        61 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Option Whisperer, Today, 09:55 AM
        0 responses
        5 views
        0 likes
        Last Post Option Whisperer  
        Started by halgo_boulder, 04-20-2024, 08:44 AM
        2 responses
        24 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X