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 Atlant, Yesterday, 10:13 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by trader3000a, Yesterday, 03:59 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by fredNT13, Yesterday, 06:40 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Started by sidlercom80, Today, 12:57 AM
      0 responses
      3 views
      0 likes
      Last Post sidlercom80  
      Started by gbajaj, Yesterday, 11:16 PM
      0 responses
      1 view
      0 likes
      Last Post gbajaj
      by gbajaj
       
      Working...
      X