Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy/Indicator Call Question

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

    Strategy/Indicator Call Question

    In my strategy i'm trying to call the AUADXVMA indicator trend variable. This is a private variable but I still think I should be able to call it without rewriting the code. All the other forums are asking similar questions but I still have not received the answer I need. See some of the code below.

    private AuADXVMA AuADXVMA1;
    AuADXVMA1 = AuADXVMA(25);

    protected override void OnBarUpdate()
    {
    if (CurrentBars[0] < 1)
    return;

    // Set 1
    (AuADXVMA1.trend[0] = 1)

    {
    EnterLong(Convert.ToInt32(DefaultQuantity), "");
    }
    }

    #2
    Hello Hruby,

    Thank you for your note.

    I don’t see any issue with the way you are writing the code, could you provide us with a copy of the strategy and indicator so we can test on our end?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thanks AlanP for your quick response.

      I figured out I needed == signs for it to work.

      ie.
      (AuADXVMA1.trend[0] == 1)

      Thank you for the great support.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      72 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      39 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X