Announcement

Collapse
No announcement yet.

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];

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        599 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        344 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        558 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        558 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X