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:	29
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:	16
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 gbajaj, Yesterday, 11:16 PM
    0 responses
    1 view
    0 likes
    Last Post gbajaj
    by gbajaj
     
    Started by PWillard, Yesterday, 10:30 PM
    0 responses
    1 view
    0 likes
    Last Post PWillard  
    Started by waldoalvarez, 06-19-2021, 05:50 AM
    2 responses
    16 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Noongun, Yesterday, 03:17 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_EricB  
    Started by Reardon, Yesterday, 12:48 PM
    1 response
    21 views
    0 likes
    Last Post NinjaTrader_EricB  
    Working...
    X