# problem to convert tick to double

16

Hello,  i'm creating a volume at price indicator.

but  after receiving the value I don't know how to convert ..

``` MqlTick tick_array[];

double volume1m [1]=0;

/////////the problem is here:
if (tick_array[0].last > 0)
{
volume1m[0] += tick_array[0].last;
}
Print (volume1m[0]);

/////I get similar value to this:         4.654716935610645e-212```

could someone help me ?

151135

really koh:

Hello,  i'm creating a volume at price indicator.

but  after receiving the value I don't know how to convert ..

MqlTick tick_array[];

double volume1m [10];

the problem is here:

volume1m[1] += tick_array[0].volume;

Print (volume1m[1] );

I get similar value to this:         4.654716935610645e-212

could someone help me ?

You did not initialize volume1m[1] to 0 prior to adding some value to it
16

You did not initialize volume1m[1] to 0 prior to adding some value to it

but, its works, its only an example, the problem is to convert like TimeToString, i need something like TickToDouble
19815

really koh: , i need something like TickToDouble

Makes no sense. tick_array[0].last and volume1m[0]  are already doubles.

16

I found the problem!

the problem is:

IF  tick_array[0].volume is 0  and the variable took it

if i use

```if (volume1m[0] > 0)
{
Print();  // it enters and returns encrypted value
}```

volume1m should be 0, becouse it took the value 0 from tick_array.. BUT NO :(
So i change to >

```if (tick_array[0].last > 0)
{
volume1m[0] =  tick_array[uz].last;
}

if (volume1m[0] > 0)
{
Print();
}```

and solved my problem

thank you!