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:	20
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:	10
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 EiorHger, Today, 05:51 AM
    0 responses
    2 views
    0 likes
    Last Post EiorHger  
    Started by space_trader, Today, 04:44 AM
    0 responses
    2 views
    0 likes
    Last Post space_trader  
    Started by ct, Today, 04:16 AM
    1 response
    17 views
    0 likes
    Last Post ct
    by ct
     
    Started by aeadon, Today, 02:27 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by op1031, Today, 01:52 AM
    0 responses
    3 views
    0 likes
    Last Post op1031
    by op1031
     
    Working...
    X