Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

number of periods on an indicator

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

    number of periods on an indicator

    Hello,

    I created an indicator a cumulative moving average.

    Does this syntax can work?

    Code:
    double value = CWMA(ChartBars.GetBarIdxByX(chartControl, cursorPointX))[0];
    Just want my cwma to appear and modify in the chart when i click on the chart anywhere.

    Error say CWMA dont exist in that context. I try to call my CWMA in another indicator.

    TY

    #2
    Hello frankduc,

    That does not look like valid code. From the description I am not certain what you are asking to do. If you can provide a more accurate description of what you are trying to do that may help.

    Comment


      #3
      Ok i have an indicator that creates a moving average, its name in the list is CMA01

      I am using another indicator i created and want my moving average the CMA01 to appear everytime i click on the chart at a different position.

      So what i did is:

      Code:
      private CMA01 value;
      than:

      Code:
      value = CMA01(ChartBars.GetBarIdxByX(chartControl, cursorPointX));

      but the line of the CMA01 wont show up. No error message.
      Print it return:

      CWMA(ES 03-23 (400 Volume),650)
      Last edited by frankduc; 12-15-2022, 01:19 PM.

      Comment


        #4
        Hello frankduc,

        If you are not sure what the syntax would be for your custom indicator you can use the strategy builder to generate the code to use it.

        Comment


          #5
          Code:
          value = CMA01(ChartBars.GetBarIdxByX(chartControl, cursorPointX));
          return:

          CWMA(ES 03-23 (400 Volume),650)

          i only want to pass the value of Bars ago we get from the DataBox.

          Comment


            #6
            Hello frankduc,

            GetBarIdxByX returns an index of a bar based on a X pixel location, that is not a BarsAgo. The error you were seeing from post 1 means that the indicators name is wrong. If you don't know what syntax your indicator needs you can use the builder to generate it.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            630 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            565 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X