Einzelnen Beitrag anzeigen
  #4 (permalink)  
Alt 23.05.16
Bw-Man Bw-Man ist offline
Neues Mitglied
 
Registriert seit: Mar 2016
Beiträge: 11
Bw-Man befindet sich auf einem aufstrebenden Ast
Standard

Habe mal am WE getestet. Ich mach da was noch falsch. Er hat Fehler mit dem
"KPeriod", dann "price=High[k];" und den mag er auch nicht "HighesBuffer[i]=max;".
------------------------------------------
'KPeriod' - function can be declared only in the global scope
-------------------------------------------
'k' - integer expression expected
-------------------------------------------
'[' - array required
----------------------------------------------
Da fehlt doch bestimmt etwas ?

int iHighest(
string symbol, // symbol
int timeframe, // timeframe
int type, // timeseries
int count, // cont
int start // start
);

//--- calculating the lowest value on the 10 consequtive bars in the range
//--- from the 10th to the 19th index inclusive on the current chart
double val_high;
int val_index_high=iHighest(NULL,0,MODE_HIGH,20,4);
if(val_index_high!=-1) val_high=High[val_index_high];
else PrintFormat("Error in call iHighest. Error code=%d",GetLastError());

//---- maximums counting High
double i,k,counted_bars,price,HighesBuffer;
int KPeriod();
i=Bars-KPeriod;
if(counted_bars>KPeriod) i=Bars-counted_bars-1;
while(i>=0)
{
double max=-1000000;
k = i + KPeriod-1;
while(k>=i)
{
price=High[k];
if(max<price) max=price;
k--;
}
HighesBuffer[i]=max;
i--;
}