Getting the moving average value
kshahnazari:
Sorry for asking such a silly question but I can't get the moving average number correctly with my code
I have checked the default metatrader moving average number and it doesn't seem ima function is equal to moving average.
-
Play videoPlease edit your post.
For large amounts of code, attach it. iMA("AUDCAD", ... // Symbol unless your dealer has adornments. Just use NULL. // Broker's use a variety of nameing patterns: EURUSD, EURUSDm, EURUSDi // "EURUSD.", "EURUSD..", "EUR.USD", "EUR/USD", "EURUSD.stp", EURUSDct, // "EURUSD.G", "EURUSD+", EURUSDpro at least.
- "Doesn't seem" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
- Print close values from bars [zero .. 13], and the ima(..., 0)
WHRoeder:
Thanks for telling me those stuff, first time in this forum needed to know those + The problem was solved by putting NULL at the first as you said , think the reason the code wasn't properly was that the pattern wasn't right and the ima couldn't get the values correctly , thanks alot/
-
Play videoPlease edit your post.
For large amounts of code, attach it. - "Doesn't seem" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
- Print close values from bars [zero .. 13], and the ima(..., 0)
Sorry for asking such a silly question but I can't get the moving average number correctly with my code
//+------------------------------------------------------------------+
//| me.mq4 |
//| Copyright 2015, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
int NewChart = 0;
void OnTick()
{
int newChartCheck = iOpen("AUDCAD",PERIOD_M15,1);
// Alert(newChartCheck);
if (NewChart != newChartCheck)
{
Alert(iMA("AUDCAD",0,14,0,MODE_SMA,PRICE_CLOSE,0));
NewChart = newChartCheck;
// Alert(iMA(NULL,0,14,0,MODE_SMA,PRICE_CLOSE,0));
}
}
//+------------------------------------------------------------------+
I have checked the default metatrader moving average number and it doesn't seem ima function is equal to moving average. I need it for the current time we're in + I checked the properties of the iMA and its all equal to the default moving average properties