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 StockTrader88, 03-06-2021, 08:58 AM
        45 responses
        3,992 views
        3 likes
        Last Post johntraderuser2  
        Started by TAJTrades, Today, 09:46 AM
        0 responses
        7 views
        0 likes
        Last Post TAJTrades  
        Started by rhyminkevin, Yesterday, 04:58 PM
        5 responses
        62 views
        0 likes
        Last Post dp8282
        by dp8282
         
        Started by realblubb, Today, 09:28 AM
        0 responses
        8 views
        0 likes
        Last Post realblubb  
        Started by AaronKoRn, Yesterday, 09:49 PM
        1 response
        19 views
        0 likes
        Last Post Rikazkhan007  
        Working...
        X