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:	36
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:	21
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)
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by gbrad, Today, 09:57 AM
    4 responses
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Cormick, 07-21-2021, 12:45 PM
    29 responses
    98 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by Airwave, Yesterday, 05:04 AM
    3 responses
    24 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by Cormick, Today, 06:26 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by r3n3v, Today, 09:58 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Kate  
    Working...
    X