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

Record price at event, more variables

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

    Record price at event, more variables

    Hi, I'm converting a strategy to an indicator and need to record the current price at an event, then add the value of a stop loss (user defined input), so I can simulate being flat again after a stop out within the indicator.
    Also I have used up the 10 user defined variables and need some more, it won't compile if I go to variable10, what do I do?
    Thanks

    #2
    Stem1, for the user defined inputs, you can definitely create yourself more, here's a detailed tip with a 'how to' - http://www.ninjatrader.com/support/f...ead.php?t=5782

    You can record / store your price in a variable when your event occurs - i.e.

    if (CrossAbove(SMA(10), SMA(20), 1))
    trackingVar = Close[0];
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Ok, inputs I can do, it's the Variables I have run out of. Can "trackingVar" be numbered like trackingVar1 etc?
      There's "no topic" in the help guide.
      Thanks

      Comment


        #4
        Sure, you can name your custom variables whatever you want to - just declare them for example like

        private double trackingVar1;

        in your class.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by geddyisodin, Yesterday, 05:20 AM
        7 responses
        45 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by gbourque, Today, 06:39 AM
        2 responses
        4 views
        0 likes
        Last Post gbourque  
        Started by cre8able, Yesterday, 07:24 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by cocoescala, 10-12-2018, 11:02 PM
        6 responses
        939 views
        0 likes
        Last Post Jquiroz1975  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X