Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multiseries stochastics

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

    multiseries stochastics

    How to set up a if condition-> enterLong, in case stochastic D crossesAbove K below 20 level? and respectivelly to enterShort in case stochastic D crossBelow K above 80 level? Both considering instrument [1] it is a Multi series strategy..

    #2
    Hi dafonseca,

    I'm not quite sure what this means.

    Do you want a condition that says if the stochastics D line crosses above the stochastics K line and both are above 20?
    Code:
    if (CrossAbove(Stochastics(BarsArray[0], 7, 14, 3).D, Stochastics(BarsArray[0], 7, 14, 3).K, 1) && Stochastics(BarsArray[0], 7, 14, 3).D > 20 && Stochastics(BarsArray[0], 7, 14, 3).K > 20)
    Or just the K line is above 20?
    Code:
    if (CrossAbove(Stochastics(BarsArray[0], 7, 14, 3).D, Stochastics(BarsArray[0], 7, 14, 3).K, 1) && Stochastics(BarsArray[0], 7, 14, 3).K > 20)
    Or just the D line is above 20?
    Code:
    if (CrossAbove(Stochastics(BarsArray[0], 7, 14, 3).D, Stochastics(BarsArray[0], 7, 14, 3).K, 1) && Stochastics(BarsArray[0], 7, 14, 3).D > 20)
    Are you wanting to use the primary data series or the secondary dataseries? Currently, the examples above use the primary data series.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I tried your condition but NT said the operator '>' cannot be applied to operands of type idataseries...Any clue?
      Also, I attached a file showing what I meant ..
      I think, when using stochastics, one must act only on botton and top.. below and above 20 and 80 lines..
      am I wrong?
      Attached Files

      Comment


        #4
        Hi dafonseca,

        Sorry about that. I was changing things around and copied the wrong line.

        The bars ago value is missing from the stochastic k and d lines being over 20.

        Corrected it looks like:
        Code:
        if (CrossAbove(Stochastics(BarsArray[0], 7, 14, 3).D, Stochastics(BarsArray[0], 7, 14, 3).K, 1) && Stochastics(BarsArray[0], 7, 14, 3).D[B][0][/B] > 20 && Stochastics(BarsArray[0], 7, 14, 3).K[B][0][/B] > 20)
        When you mention "when using stochastics, one must act only on botton and top.. below and above 20 and 80 lines" I'm not quite sure what you mean by this. Are you saying the K line must be above and below 80? Does this mean that the K line must be above 20 to enter long and below 80 to enter short?

        Can you clarify this for me?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X