Velly123:
Please edit your post . . . .Hi, any one who can help me with the code below(calling indicator).When I compile it is ok with no errors but when I drag it to the chart nothing is happening.
I am still new with coding I need help to learn to write codes
Thanks
<SNIP>
Please use this to post code . . . it makes it easier to read.
Do you have a smiley face in the top right hand corner of your chart ?
Did you click the Expert Advisors button so it shows a green arrow ?
RaptorUK:
Do you have a smiley face in the top right hand corner of your chart ?
Did you click the Expert Advisors button so it shows a green arrow ?
Thank you, my EA button was not showing the green arrow. EA is working.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi, any one who can help me with the code below(calling indicator).When I compile it is ok with no errors but when I drag it to the chart nothing is happening.
I am still new with coding I need help to learn to write codes
Thanks
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
extern int Period_MA = 21; // Calculated MA period
bool Market_above = true; // Fact of report that price
bool Market_below = true; // .. is above or below MA
//------------------------------------------------------------------
int start() // Special function start()
{
double MA; // MA value on 0 bar
//-------------------------------------------------------------------
//Tech. ind. function call
MA=iMA(NULL,0,Period_MA,0,MODE_SMA,PRICE_CLOSE,0);
//-------------------------------------------------------------------
if (Bid > MA && Market_above == true) //Checking if price above
{
Market_above = true; //Report about price above MA
Market_below = false; //Don't report about price below MA
Alert("Price is above MA(",Period_MA,").");//Alert
}
//-------------------------------------------------------------------
if (Bid < MA && Market_below == true) //Checking if price below
{
Market_below = true; //Report about price below MA
Market_above = false; //Don't report about price above MA
Alert("Price is below MA(",Period_MA,").");//Alert
}
//+------------------------------------------------------------------+
return;
}
//+------------------------------------------------------------------+