Salve a tutti ,
sto cercando qualche anima buona che mi aiuti a fare un semplice allarme multi-time applicato a un indicatore, programmando il tutto in Mql5.
C'è qualcuno che ne è capace ?
Grazie anticipatamente.


#property copyright "Copyright 2011, MetaQuotes Software Corp."
#property link "http://www.mql5.com"
#property version "1.00"
#property indicator_chart_window
#property indicator_buffers 1
double CCI_Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,CCI_Buffer,INDICATOR_DATA);
//---
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime& time[],
const double& open[],
const double& high[],
const double& low[],
const double& close[],
const long& tick_volume[],
const long& volume[],
const int& spread[])
{
//---
int myCCI = iCCI(NULL,0,14,PRICE_CLOSE);
if (CopyBuffer(myCCI, 0, 0, rates_total, CCI_Buffer) != rates_total) return(0);
// quello che segue è solo un esempio
if (( CCI_Buffer[....0...] > 0 ) && //barra che si sta formando
( CCI_Buffer[....-1...] < 0 ) &&
( CCI_Buffer[....-2...] < 0 ) );
{
Alert ("TEST");
}
}
//--- return value of prev_calculated for next call
return(rates_total);
}


lady_sabry ha scritto:....nessuno ?.....

Visitano il forum: CommonCrawl [Bot] e 0 ospiti