Find ChartID by periode

 
Hi,

i try to draw on a chart.

For the first one (Period M1) it works fine.

For the second one (Period M5) it failed. I think i need to find the chartid for the second chart but how i can do it? Is there a function to get the chartid by periode?

Also i wondering, if i make a smal loop it only print out "12345". But I would have expected that it would output 2 different IDs (for M1 and M2)?

 long chartID=ChartFirst();
    while(chartID >= 0)
  {
   Print("chartID:"+chartID);
   chartID = ChartNext(chartID);
  }
  Print("Current ChartID:"+ChartID());
 
  1. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.

    You are printing IDs. Where is your output?


  2. You do not have a second chart open. You are mistaking a different period for a different chart.
 
Sorry I don't want to upset anyone.

In fact, I wasn't sure if my statements were clear enough and sufficient.

But I think your hint could help. I thought that a new chart window also meant a new window with the period. Obviously not!?

How can I draw something specifically in the chart of a period within a chart window (probably a window that belongs to an EA, for example)?

Maybe its important to inform that i work at the moment only in the strategytester.




 
ReLor2 #:
Sorry I don't want to upset anyone.

In fact, I wasn't sure if my statements were clear enough and sufficient.

But I think your hint could help. I thought that a new chart window also meant a new window with the period. Obviously not!?

How can I draw something specifically in the chart of a period within a chart window (probably a window that belongs to an EA, for example)?

Maybe its important to inform that i work at the moment only in the strategytester.




It doesn't work with the Strategy Tester. You can draw only on the main chart, not the others, this is a Strategy Tester limitation.
 
Oh ok, thats important to know;-))

But is a new period a new chartid or not?
 
ReLor2 #:
Oh ok, thats important to know;-))

But is a new period a new chartid or not?

Your question doesn't make sense.

Each chart has it's own chartID, whatever the timeframe (period) used on this chart.

 
Sorry to find not the correct words for my question.

Let me try again.

If i add a Currency pair with a Period = Chart 0

now i want to see a second period = Chart 1

Correct?

How i can get the Chart ID for the second period? Is there a function for it, or can i set the ChartID by myself?
 
ReLor2 #:
Sorry to find not the correct words for my question.

Let me try again.

If i add a Currency pair with a Period = Chart 0

now i want to see a second period = Chart 1

Correct?

How i can get the Chart ID for the second period? Is there a function for it, or can i set the ChartID by myself?
With the code you posted on your first post, but NOT with the Strategy Tester, it's not possible.
 
ReLor2 #: Let me try again.

If i add a Currency pair with a Period = Chart 0

now i want to see a second period = Chart 1

Correct?

How i can get the Chart ID for the second period? Is there a function for it, or can i set the ChartID by myself?

Not correct.

  1. You can just change the chart period, same chart, different period. There is only one chart ID. Not in the tester.
  2. You can open a second chart, with a second period. But you must switch charts, manually or with code. Not in the tester.
Reason: