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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      60 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      145 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      161 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      97 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      283 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X