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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      68 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      150 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X