Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CrossUnder Argument problem

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

    CrossUnder Argument problem

    i want to test SpanRSI for CrossBelow a trigger value. SpanRSI is Series<double>. SpanTrigger is double. The conditional statement below produces an error.

    if (CrossBelow(SpanRSI[0], SpanTrigger, 1) )
    {
    Print(string.Format("CurrentBar {0} SpanRSI[1] {1:0} SpanRSI[0] {2:0} ", CurrentBar, SpanRSI[1], SpanRSI[0] ));
    }

    errors 1. overload method match for CrossBelow has invalid arguments
    2. Argument 2 can not convert from double to ISeries<double>

    The help manual specifies that an ISeries<double> is required as
    CrossBelow(ISeries<double>series1,doublevalue,intlookBackPeriod)

    What can be done to take a variable i create and subject it to CrossBelow? Thanks!

    #2
    Hello Kicks.Spin,

    Thanks for your post.

    You have a correct understanding from the help guide in that one of the two arguments needs to be a series. In both instances, you have a double value.

    If SpanRSI is a series then SpanRSI[0] would be the current bar value (a double value) of that series.

    Try: if (CrossBelow(SpanRSI, SpanTrigger, 1) )

    Comment


      #3
      Thanks Paul. Works great. Makes sense the method would need all series values to make a crossunder comparison some n number or bars back.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      83 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      45 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      65 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      68 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      56 views
      0 likes
      Last Post CarlTrading  
      Working...
      X