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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        169 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        328 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        252 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        353 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        181 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X