rod178: why does the following line of code produce these two warning messages - Print(ObjectGetValueByTime("test2a",Time[1],0)); "implicit conversion from 'string' to 'number' " "implicit conversion from 'number' to 'string' " Also it returns a value (Price) of 0.0, despite the Trendline ("test2a") intersecting m15 Time[1] |
|
WHRoeder:
rod178: why does the following line of code produce these two warning messages - "implicit conversion from 'string' to 'number' " "implicit conversion from 'number' to 'string' " Also it returns a value (Price) of 0.0, despite the Trendline ("test2a") intersecting m15 Time[1] |
|
Well, here is the code in its entirety . Print usually performs automatic type conversion. Nevertheless I added DoubleToString and it still produces the same warnings
//+------------------------------------------------------------------+ //| test.mq4 | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property version "1.00" #property strict //#property script_show_inputs //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { Print(DoubleToString(ObjectGetValueByTime("test2a",Time[1],0),4)); }
PS Furthermore this returns a value of 2, which is OBJ_TREND
Print("****object type integer ",ObjectType("test2a"));

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
why does the following line of code produce these two warning messages -
"implicit conversion from 'string' to 'number' "
"implicit conversion from 'number' to 'string' "
Also it returns a value (Price) of 0.0, despite the Trendline ("test2a") intersecting m15 Time[1]