Hello everyone,
I'm new to this community, and Forex trading. Hope I will learn a lot here!
Let's get on with my first question. From the start I want to learn to program my own expert advisors to help me with certain tasks.
Just for exercise purposes I coded a quick EA that notifies you when three different moving averages cross at the same point (their values are the same).
here is the code:
The problem is IT DOES NOT WORK. I tried just about everything for some reason it does not want to work.
Can anybody please show me what I am doing wrong?
Thanks!
I'm new to this community, and Forex trading. Hope I will learn a lot here!
Let's get on with my first question. From the start I want to learn to program my own expert advisors to help me with certain tasks.
Just for exercise purposes I coded a quick EA that notifies you when three different moving averages cross at the same point (their values are the same).
here is the code:
Inserted Code
double sma =iMA(NULL,0,14,0,MODE_SMA,PRICE_CLOSE,0);
double ema = iMA(NULL,0,14,0,MODE_EMA,PRICE_CLOSE,0);
double lwma = iMA(NULL,0,14,0,MODE_LWMA,PRICE_CLOSE,0);
if ((sma == ema) || (sma == lwma) || (ema == lwma) )
{
PlaySound("Alarm.wav");
Alert("Crossed MA!");
} The problem is IT DOES NOT WORK. I tried just about everything for some reason it does not want to work.
Can anybody please show me what I am doing wrong?
Thanks!