ChartIndicatorsTotal

Retourne le nombre d'indicateurs attachés à la fenêtre indiquée du graphique.

int  ChartIndicatorsTotal(
   long  chart_id,      // l'identificateur du graphique
   int   sub_window     // le numéro de la sous-fenêtre
   );

Paramètres

chart_id

[in]  L'identificateur du graphique. 0 signifie le graphique actuel.

sub_window

[in]  Le numéro de la sous-fenêtre du graphique. 0 signifie la fenêtre principale du graphique.

Valeur de Retour

Le nombre d'indicateurs dans la fenêtre spécifiée du graphique. Pour obtenir plus d'information sur l'erreur, il faut appeler la fonction GetLastError().

Note

La fonction est conçue pour trier tous les indicateurs attachés à ce graphique. Il est possible d'obtenir le nombre de fenêtres du graphique stocké dans la propriétéCHART_WINDOWS_TOTAL avec la fonctionChartGetInteger().

Exemple :

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- récupère l'identifiant du graphique actuel et le numéro de ses sous-fenêtres, y compris la fenêtre principale
   long chart_id = ChartID();
   int  wnd_total= (int)ChartGetInteger(0,CHART_WINDOWS_TOTAL);
   
//--- parcours toutes les fenêtres de graphique actuelles dans une boucle
   for(int w=0w<wnd_totalw++)
     {
      //--- obtient le nombre d'indicateurs attachés à la fenêtre graphique spécifié par l'index de la boucle
      int ind_total=ChartIndicatorsTotal(chart_idw);
      
      //--- récupère le nombre d'indicateurs attachés à la fenêtre spécifiée du graphique
      PrintFormat("Chart ID %I64d, subwindow %d. Attached indicators: %d"chart_idwind_total);
     }
   /*
   résultat :
   Chart ID 133246248352168439subwindow 0Attached indicators3
   Chart ID 133246248352168439subwindow 1Attached indicators2
   Chart ID 133246248352168439subwindow 2Attached indicators1
   */
  }

Voir aussi

ChartIndicatorAdd(), ChartIndicatorDelete(), iCustom(), IndicatorCreate(), IndicatorSetString()