[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 374

 

Hello.

I have this question:

I write double Price= NormalizeDouble(OrderOpenPrice(),Digits) in the script;

Then I Alert ("open price",Price );

As a result, I see the following message on the screen: Open Price. 1.5465

All would be good, but my brokerage company is Alpari. My broker has five decimal places.

I do not know why I got this way, please explain.

 
Skander:

Hello.

I have this question:

I write double Price= NormalizeDouble(OrderOpenPrice(),Digits) in the script;

Then I Alert ("open price",Price );

As a result, I see the following message on the screen: Open Price. 1.5465

All would be good, but my brokerage company is Alpari. My broker has five decimal places.

Please explain why it happens?

void Alert( ...)
Displays a dialog box containing user data. Parameters can be of any type. The number of parameters cannot exceed 64.

Arrays cannot be passed to Alert(). Arrays must be output element by element.

Data of type double is output with 4 decimal digits after the point. To output numbers with higher accuracy, use the DoubleToStr() function.
 
Skander:

Hello.

I have this question:

I write double Price= NormalizeDouble(OrderOpenPrice(),Digits) in the script;

Then I Alert ("open price",Price );

As a result, I see the following message on the screen: Open Price. 1.5465

All would be good, but my brokerage company is Alpari. My broker has five decimal places.

Please explain why?


The default setting Print, Alert and Comment are accurate to 4 decimal places.

Use DoubleToStr()

 

Please help me with my situation!

I find a bar that corresponds to a maximum in a certain interval, how can I memorise it so that I can quickly refer to this bar in the future?

 
Andreev:

Please help me with my situation!

I find a bar that corresponds to a maximum in a certain interval, how can I memorise it so that I can quickly refer to this bar in the future?

Save the time of that bar in a variable. Then use iBarshift() to retrieve the memorised bar by substituting the value stored in the variable as the time
 
artmedia70:
Save the time of this bar in a variable. Then use iBarshift() to retrieve the remembered bar, substituting the value stored in the variable
as the time.

Can you tell me how to determine the time of this bar? I can only determine the number of bars from zero, can you help? Thanks for the iBarshift function!
 
Can you tell me how to track several currency pairs at once? I understand that I need to write the same code as for a normal EA, but to specify a specific currency instead of Symbol()? How many times I have to write it... There must be something easier... Tell me how to do it...
 
CLAIN:
Can you tell me how to track several currency pairs at once? I understand that I need to write the same code as for a normal EA, but to specify a specific currency instead of Symbol()? How many times I have to write it... There must be something easier... Tell me how to do it...
You can substitute symbols in the loop.
 
Andreev:

Can you tell me how to determine the time of this bar? I can only determine the number of bars from zero, can you help? Thanks for the iBarshift function!

Time[bar_number]; // For current period and instrument

iTime(); // Universal function

Type in the metaheditor, put the cursor on it and press F1

 
Thank you!!!