Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

I want to compare the Close[0] relative to a custom MA line

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

    I want to compare the Close[0] relative to a custom MA line

    tried this:-

    Code:
    
    if ((Close[0] > draftMA1(Close,5)))
    {
    EnterLong();
    }
    
    Got this error:-
    Operator '>' cannot be applied to operands of type 'double' and NinjaTrader.Indicator.draftMA1'

    #2
    Hi kaywai,

    I am not familiar with the draftMA1 indicator, but it is likely you need a barsAgo reference, so something like...

    if (Close[0] > draftMA1(Close,5)[0])
    TimNinjaTrader Customer Service

    Comment


      #3
      that removed the error! Thx Tim!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Futurestrader00, Yesterday, 06:14 PM
      1 response
      17 views
      0 likes
      Last Post cincai
      by cincai
       
      Started by ballston, Today, 06:32 AM
      0 responses
      3 views
      0 likes
      Last Post ballston  
      Started by Danila, Today, 04:38 AM
      2 responses
      7 views
      0 likes
      Last Post Danila
      by Danila
       
      Started by sinpeople, Today, 04:38 AM
      0 responses
      7 views
      0 likes
      Last Post sinpeople  
      Started by kiffgj, Today, 04:23 AM
      0 responses
      8 views
      0 likes
      Last Post kiffgj
      by kiffgj
       
      Working...
      X