Thanks everybody!Originally Posted by ;
![]() |
![]() |
Out of Meta Editor MQL Reference:
dual iMA( string symbol, int interval, int interval, int ma_shift, int ma_method, int applied_price, int shift)Calculates the Moving average indior and returns its value.
Parameters:
symbol - Symbol the information of which should be used to calculate indior. NULL means the current symbol.
Interval - Timeframe. It may be any of help://constants_timeframes values. 0 signifies the current chart interval.
Hey david.... In mq4 's value is dependent upon where/how it is used.... In some instances
NULL == Symbol(); //-- meaning the associated chart at hand
and in some instances
NULL == 0;
//-----
in some instances it is okay to subsitute NULL for Symbol() or for an anticipated value....
Inserted Code dual stoch0 = iStochastic(NULL,0,21,4,4,MODE_SMA,0, MODE_MAIN,0); dual stoch1 =I Stochastic(Symbol(),0,21,4,4,MODE_SMA,0, MODE_MAIN,1); OrderSend(Symbol(),OP_SELL,Lots(),Bid,NULL,NULL,NU LL,NULL,NULL,NULL,Blue);
and in some instances It's not....
Inserted Code OrderSend(NULL,OP_BUY,Lots,Ask,3,Ask-Stoploss*Stage,Ask ProfitTarget*Point,,MagicNumber,0,Blue);
bottom point is only Rosh , Stringo , Lenar would understand the if then code .... We all understand mostly by trial and error...h
It's totally different from all the other NULLs you are knowledgeable about.Originally Posted by ;
With MQL4, NULL means the default Symbol(). So, Symbol()=NULL, NULL=Symbol().
I believe Null in will mean exactly the same as it does in MS Access, SQL Server.
0 or a 'blank' is not the same as , means unknown, either a zero or blank means nothing whatsoever. Nothing really isn't the same a unknown.
For instance 2 0 = 2, but 2 = .
Or 'hello' ? = 'hello', but 'hello' = .
Anything not yet given a value is . If you'd like things to be blank you've got to specifically put them to clean.
Works Exactly the same.
I figure it makes the code slightly faster since NULL is a genuine worth while Symbol() has to get a value (chart timeframe).
I wondered. When using iMA() or any other indior feature, I use Symbol() for your initial paramter. For example,
PHP Code: <code><span style=”color: #000000”> <span style=”color: #0000BB”>doubleEMAHighValue</span><span style=”color: #007700”>=</span><span style=”color: #0000BB”>iMA</span><span style=”color: #007700”>(</span><span style=”color: #0000BB”>Symbol</span><span style=”color: #007700”>(),</span><span style=”color: #0000BB”>0</span><span style=”color: #007700”>,</span><span style=”color: #0000BB”>EMAHigh</span><span style=”color: #007700”>,</span><span style=”color: #0000BB”>0</span><span style=”color: #007700”>,</span><span style=”color: #0000BB”>MODE_EMA</span><span style=”color: #007700”>,</span><span style=”color: #0000BB”>PRICE_HIGH</span><span style=”color: #007700”>,</span><span style=”color: #0000BB”>1</span><span style=”color: #007700”>);
</span><span style=”color: #0000BB”></span> </span> </code> What would be the difference if I place NULL Rather than Symbol()?
Thanks fellow developers.
.