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 sjsj2732, 03-23-2026, 04:31 AM
          0 responses
          42 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          295 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          290 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          135 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          98 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X