Errors, bugs, questions - page 1166

 

artmedia70:

And print the id immediately, while it is in long and not converted?

The global variation is a double type, possibly a rounded value in the window

 
Swan:

And print the id immediately while it is in long and unconverted?

global variation - type double, possibly rounded value in the window

Of course I did that too:

         Print("Значение в ней = "+DoubleToString(GlobalVariableGet(gv_name),0));

same thing...

 
artmedia70:

Of course I did:

same thing...

No, no conversion.
Print(ChartID());
check out
 
Swan:
No, no transformation.
see
So it will return the ID of the chart where the indicator is installed, not the ID I'm trying to pass to the indicator via GV
 
artmedia70:
This way, it will return the ID of the chart where the indicator is installed, not the ID I'm trying to pass to the indicator via GV

Then print it out from the programme you are sending it from.

 
Swan:

Well, print it out from the program you're sending it from.

Yes, I already did. The value in GV is 4 more than in the program:

2014.07.05 05:01:55.508 Multick EURUSD,H4: ID EURUSD : 130462919691841406

GV = 130462919691841410

I'll keep looking into it.

 
Double cropping is possible. You have to shove the long into the double union custom, not directly. And unpack the same way.
 
TheXpert:
Double cropping is possible. You have to shove the long into the double union custom, not directly. And unpack the same way.
Maybe, but it does seem to transfer correctly. In the"Global Variables" window the value is rounded, it shows 17 digits.
 
TheXpert:
Double trimming is possible. You should shove the long into the double union cast, not directly. And unpack the same way.

Double shreds:

//----------------------------
   string gv_chart_id_name=Prefix+"_chart_id";
   long chart_id=get.GetChartID(symbol);
   graph.Message("ID "+symbol+" : "+IntegerToString(chart_id)+", ChartSymbol(chart_id) возвращает "+ChartSymbol(chart_id));
   if(chart_id>=0) GlobalVariableSet(gv_chart_id_name,chart_id); // chart_id==0 в тестере
   else graph.Message("Чё-та нету chart_id : Symbol()="+symbol+", chart_id="+IntegerToString(chart_id));
   graph.Message("GV без приведения типа = "+GlobalVariableGet(gv_chart_id_name));
   graph.Message("GV с приведением типа = "+DoubleToString(GlobalVariableGet(gv_chart_id_name),0));
//----------------------------

We get it:


 
Union caste to the rescue. It is legal in mql5 even through structures.
Reason: