Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DoubleStochastics won't validate under CrossAbove Logic

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

    DoubleStochastics won't validate under CrossAbove Logic

    I'm trying to have a entry position based on the K value crossing the 10 value. I can get it to work through:

    Click image for larger version

Name:	Example.PNG
Views:	138
Size:	11.1 KB
ID:	1151485

    But this doesn't give me the precise entry I want, even though it's somewhat correct.

    I took multiple examples trying to answer this:

    Click image for larger version

Name:	Capture.PNG
Views:	100
Size:	35.7 KB
ID:	1151486


    As a result I get this:

    Error CS1503 Argument 1: cannot convert from 'double' to 'NinjaTrader.NinjaScript.ISeries<double>'

    Warning CS0436 The type 'Indicator' conflicts with the imported type 'Indicator' in 'NinjaTrader.Vendor, Version=8.0.24.1, Culture=neutral, PublicKeyToken=null'.


    Is it possible to fix it, allowing the DoubleStochastic to go through a CrossAbove/Under logic?

    If so, following the Error & Warning, do I need to create a custom DoubleStochastic, add a double reference (or something else), thus allowing it to follow the CrossAbove Rule?


    Thanks in Advance.
    Last edited by sentient254; 04-14-2021, 05:30 AM.

    #2
    Hello sentient254,

    Thanks for your post.

    With reference to the help guide for the CroosAbove method, there are two ways to use the method 1) with two series, 2) with 1 series and 1 fixed value. Reference: https://ninjatrader.com/support/help...crossabove.htm

    To detect the crossabove the 10 line, you would use the syntax of CrossAbove(ISeries<double> series1, double value, int lookBackPeriod)

    You were close with CrossAbove(DoubleStochastics(10).K[0], 10, 1) however when you used [0] this tells the method you want to use the current bar value when it was expecting the entire series, thus generating the error.

    The correct way to do this is CrossAbove(DoubleStochastics(10), 10, 1)

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    43 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    48 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X