Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exposing a Variable for use in a strategy

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

    Exposing a Variable for use in a strategy

    I am working on a strategy which will go long if certain conditions are met and an avg line, which changes color depending on its slope, is the right color. To make the "color" available to a strategy I have created a variable which is set to a number depending on the color of the plot. I've embedded along with the plot statement but I don't know how to make it accessible to a strategy. Here's a sample of the code:

    Code:
    if (Rising(SMA(Period)))
         {
         // Connects the rising plot segment with the other plots
         RisingPlot.Set(1, SMA(Period)[1]);
         LColText = 1;
         }
    I'm pretty sure I need to somehow add a statement in the "Properties" section
    or perhaps do that as well as create a dataseries but the things I've tried don't work. If there is a code sample somewhere that outlines this I would be grateful to see it.
    Thanks
    DaveN

    #2
    You would need to expose this dataseries in the indicator to access it in the strategy then - http://www.ninjatrader-support2.com/...ead.php?t=4991

    Comment


      #3
      Exposing a Variable for use in a strategy

      Bertrand,
      Thanks for your help and guidance to the sample code. It works though I am still having trouble making the text variable visible outside the indicator so that it can be used in a strategy.
      Thanks
      DaveN

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      60 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      146 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      161 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      97 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      284 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X