- Push Notifications - MetaTrader 5 for Android
- Migration - Virtual Hosting for 24/7 Operation
- Push Notifications - MetaTrader 5 for iPhone
sure, see attached. If you see the first 2 yellow circles, i essentially want to know that in the last 20 data points i have had a minimum and a maximum point on the moving average to trigger a trade execution.
I hope what i am saying is clear, please ask for more questions if not.
Below is the code i have so far.
// Check data for turning points
for(int count =MASize;Count=0; count--)
{
double ma[];
ArraySetAsSeries(ma,true);
int maHandle = iMA(_Symbol,_Period,MAPeriods,0,MAMethod,PRICE_CLOSE);
CopyBuffer(maHandle,0,0,MASize,ma);
double MAValuea = ma[count];
double MAValueb = ma[count+1];
double MAValuec = ma[count+2];
string MinOrMax;
if(MAValuea-MAValueb>0 && MAValueb-MAValuec<0)
{
MinOrMax = "min"
}
if(MAValuea-MAValueb<0 && MAValueb-MAValuec>0)
{
MinOrMax = "max"
}
// then loop through to find other turning points
}
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use