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 op1031, Yesterday, 05:16 PM
      1 response
      8 views
      0 likes
      Last Post NT-Roland  
      Started by sinpeople, Today, 07:20 AM
      1 response
      3 views
      0 likes
      Last Post NT-Roland  
      Started by Frank1000, Today, 03:05 AM
      1 response
      8 views
      0 likes
      Last Post NT-Roland  
      Started by ntdev, Today, 01:14 AM
      4 responses
      16 views
      0 likes
      Last Post ntdev
      by ntdev
       
      Started by ct, Today, 02:22 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Jason  
      Working...
      X