Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with simple donchian cross test

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

    Problems with simple donchian cross test

    I'm testing some simple strategies and am stumped on what I assume to be a dumb user error.
    The test I'm trying right now is to just plot an arrow when High is above the prior bars upper donchian channel. I've also tried doing this as a crossup.
    Neither one seems to trigger.
    I'd appreciate it if you can take a gander.. probably just needs a fresh set of eyes




    --------- Sample 1 --------
    protected override void Initialize()
    {
    Add(DonchianChannel(DonchianPeriods));
    CalculateOnBarClose = false;
    }
    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (High[0] > DonchianChannel(DonchianPeriods).Upper[1])
    {
    DrawArrowUp("My up arrow" + CurrentBar, 0, 0, Color.Lime);
    }
    }

    --------------Sample 2 Signal on cross over upper channel -----------------
    protected override void Initialize()
    {
    Add(DonchianChannel(DonchianPeriods));
    CalculateOnBarClose = false;
    }

    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (CrossAbove(High, DonchianChannel(DonchianPeriods).Upper, 1))
    {
    DrawArrowUp("My up arrow" + CurrentBar, 0, 0, Color.Lime);
    }
    }



    #2
    imported post

    You are passing in "0" for the y co-ordinate of the arrow plot. Try:

    DrawArrowUp("My up arrow" + CurrentBar, 0, Low[0] - TickSize, Color.Lime);

    Ray
    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      Thank you Ray

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      558 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X