Hallo experts,
Question is how to take value from custom indicator to strategy ?
I build indicator with some signals and put it in with iCustom(…); It works fine but
Is some solution how to export that bool variables to strategy ?
here is part from indicator :
bool SetBuy = false; <-- this value
bool SetSell = false; <-- this
bool SetCross = false; <-- and this
int OnCalculate (const int rates_total,
const int prev_calculated,
const int begin,
const double& price[] )
{
for (int i=(int)MathMax(prev_calculated-1,0); i<rates_total; i++)
{
MA_Value[i] = iMajster(price[i],Length,i,0);
if (i>0)
{
colorBuffer[i] = 2;
if (MA_Value[i] > MA_Value[i-1])
{
SetBuy = true; <-------- here it changes from true to false
SetSell = false; <--------
colorBuffer[i]=0;
}
if (MA_Value[i] < MA_Value[i-1])
{
SetSell = true; <--------
SetBuy = false; <--------
colorBuffer[i]=1;
}
if (MA_Value[i] == MA_Value[i-1])
{
SetCross = true; <--------
SetBuy = false; <--------
SetSell = false; <--------
colorBuffer[i]=2;
}
}
}
return(rates_total);
}