Function to return indicator's value...
Just get the value(s) of the indicator(s) into the EA (using iCustom) and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting.
Detailed explanation of iCustom - MQL4 programming forum
You should encapsulate your iCustom calls to make your code self-documenting.
Detailed explanation of iCustom - MQL4 programming forum
William Roeder:
Just get the value(s) of the
indicator(s) into the EA (using iCustom) and do what you want with it.
You should encapsulate your iCustom calls
to make your code self-documenting.
Detailed
explanation of iCustom - MQL4 programming forum
Thank you.
I looked at iCustom and handle them.
Finally, I used the handle of the functions that interested me directly.
I do not know if it is correct but it seems to work as I wanted.
//+------------------------------------------------------------------+
void OnTick()
{
//---
double BullsBuffer[];
double BearsBuffer[];
int bullsPwr = iBullsPower(Symbol(), 0, 13);
int bearsPwr = iBearsPower(Symbol(), 0, 13);
if(CopyBuffer(bullsPwr,0,0,1,BullsBuffer)<0)
{
Alert("Error copying indicator iBullsPower - error:",GetLastError(),"!!");
return;
}
if(CopyBuffer(bearsPwr,0,0,1,BearsBuffer)<0)
{
Alert("Error copying indicator iBearsPower - error:",GetLastError(),"!!");
return;
}
BullsBuffer[0]=NormalizeDouble(BullsBuffer[0],3);
BearsBuffer[0]=NormalizeDouble(BearsBuffer[0],3);
Comment("Bulls : ", BullsBuffer[0], " Bears : ",BearsBuffer[0]);
}
//+------------------------------------------------------------------+
For example for the bear or bulls indicator.s
Could you give me a link or sample code ?