Price

 

Hi,

I am trying to create an ea using fibs and what i am trying to do is

taking todayClose + (yesterday High - yesterday Low ) * 0.382;

but when i send this at order send function the tester shows inalid price ?? e.g 1.28574534 something like this any help

thanks.

 

I think you can use NormalizeDouble

double var1=0.123456789;

Print(NormalizeDouble(var1,4));

// output: 0.1234

 
lowphat:
I think you can use NormalizeDouble

double var1=0.123456789;

Print(NormalizeDouble(var1,4));

// output: 0.1234

lowphat many thanks for the suggestion but i think since the ea could run on any currency putting something hardcoded wont work i think i try to use your suggestion for eur/usd now untill i find someother solution.

regards.

 

Say, price = todayClose + (yesterday High - yesterday Low ) * 0.382

You apply the Normalize double like this:

NormalizeDouble(price, Digits);

Digits is the built in rounding off parameter.

 

Maji,lowphat thanks i understand now what is implied with Normalize Double Method.

Reason: