Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Referencing chart time-frame

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

    Referencing chart time-frame

    Hello,

    Is there a way for an indicator to reference the chart time-frame ?
    I would like to have a self-adjusted indicator that references one of its parameters to the specific time frame of the current chart.

    Thanks.

    #2
    bkool,

    do you mean something like this?

    if (Bars.Period.Id == PeriodType.Minute)
    {
    if (myTimeInterval < Bars.Period.Value)
    {...}
    }

    Regards
    Ralph

    Comment


      #3
      Thanks Ralph.

      Not sure though. I use Range bars. In this case - can I use the following?

      if (BarsPeriod.Id == PeriodType.Range)
      {(myRangePeriod == BarsPeriod.Value)}

      if (myRangePeriod = 5)
      {...}

      Comment


        #4
        Yes.

        Regards
        Ralph

        Comment


          #5
          Well,
          I've managed to work it out by adding the following code to the ZigZag indicator in the OnBarUpdate section:
          //-------------------
          // adjust deviationValue according to chart Range-frame
          double myRangePeriod = 0;
          if (BarsPeriod.Id == PeriodType.Range)
          {
          myRangePeriod = BarsPeriod.Value;
          deviationValue = (myRangePeriod +3.045)/31.23;
          //Print ("BarsPeriod.Value =" + BarsPeriod.Value.ToString());
          //Print ("deviationValue = " + deviationValue.ToString());
          }
          //-------------------

          The ratio deviationValue = (myRangePeriod +3.045)/31.23 was observed specifically for the TF contract by comparing various combinations of the two variables.

          Thanks much Ralph.

          bkool
          Last edited by bkool; 05-23-2010, 02:16 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          581 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          338 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X