Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Range Bars

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

    #16
    For some reason is not working fine.

    It is just working the days in which the 4 Range chart has a 07 o'clock bar.

    Is this the correct syntax?:
    protected override void Initialize()
    {

    Add(PeriodType.Minute, 1);
    }

    protected override void OnBarUpdate()
    {
    if (BarsInProgress==1)
    {
    return;
    }

    if (ToTime(Times[1][0])==70000)
    {
    "Place Stop Orders..."

    }

    }

    Thanks

    Comment


      #17
      CJS, to which series are you then submitting your orders? What is the TraceOrders output saying?

      Comment


        #18
        I have a (4 Range) chart with the strategy. In the script I have added a 1 min series.

        I use that 1 min series to get a reference value, which I store in a double variable. This value is the Open of the 7 o'clock bar.

        if (ToTime(Times[1][0])==70000)
        {
        referenciaprecio = Opens[1][0];
        }

        I use this value (Open of the 7:00 bar) Ito build up the whole strategy everyday.

        But, for some reason, in the 4 Range chart the strategy is working fine just those days with a 7:00 bar. If this bar do not exist, nothing happens that day.

        Even though I have added the 1 min series, the problem could be that this 1 min series is almost everyday slower than the 4 Range. Generally, the 7 :00 1-min bar is within a 4 Range bar which took 3-4 minutes to form. Probably the problem is around this idea.

        Nothing appers in the TraceOrders output those days.

        Comment


          #19
          CJS, please try something like this below from 24 / 7 ES chart for example, it should on the next range bar open after the 1 min hit the 7000 AM signal, Exit would be just on close then...just for demo purposes.

          Code:
          protected override void Initialize()
                  {
                      CalculateOnBarClose = true;
          			Add(PeriodType.Minute, 1);
                  }
          
                  /// <summary>
                  /// Called on each bar update event (incoming tick)
                  /// </summary>
                  protected override void OnBarUpdate()
                  {
          			if (BarsInProgress != 1)
          				return;
          			
          			if (ToTime(Times[1][0]) == 070000 && Position.MarketPosition == MarketPosition.Flat)
          				EnterLong(0, 1, "1Min wants to be long");
          			
                  }

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          578 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 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
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X