[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 157

 
r772ra:

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

example:

Thanks for the tip Why aren't the current MACD line values displayed correctly in the Comment?
 
MK07:
Thanks for the tip. Why are the current MACD line values shown incorrectly in the Comment?

Read again, carefully: for Comment(), Alert() and Print()

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

 
r772ra:

Read again, carefully: for Comment(), Alert() and Print()

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

Thanks a lot again, I've already fixed it! But why do the numeric values (Macd1Buffer and Signal1Buffer) in Comment and the current values (Macd1Buffer[i] Signal1Buffer[i]) of the MACD lines not match anyway?
 
MK07:
Thanks a lot again, I've already fixed it! But why do the numeric values (Macd1Buffer and Signal1Buffer) in Comment and the current values (Macd1Buffer[i] Signal1Buffer[i]) of MACD lines not coincide?

This is because after the loop for(i=0;i<=limit;i++) ends, the i variable equals limit+1, which means that even if limit is 0, comment will print at least the first buffer value, but not the current (zero) one

The correct Comment(Macd1Buffer[0], Signal1Buffer[0])

 
alsu:

This is because after the loop for(i=0;i<=limit;i++) ends, the i variable equals limit+1, which means that even if limit is 0, comment will print at least the first buffer value, but not the current (zero) one

Correct Comment(Macd1Buffer[0], Signal1Buffer[0])

Thank you for the clarification and science! Sometimes you miss an important "detail".
 
in the test it works, but in real life it does not in a 5-digit account, but in a 4-digit account everything is OK vClose[0] = (Bid+Ask)/2.0; the value in the comment shows a 4-digit
 
r772ra:

It's all wrong, think about it, you want to prescribe (or ), so the price is always, either above... or below... level.

Try searching the forum, somewhere it was discussed "breaking the level" .

Thanks for the tips, I'll fix it and keep looking.
 
Armen63:
the advisor works in the test, but not in real life in a 5-digit account, but in a 4-digit account everything is fine vClose[0] = (Bid+Ask)/2.0; the value in the comment shows a 4-digit
string DoubleToStr ()

to help.

 

Hello, Could you please tell me how to spell the code in the function to increase the lot so that it was not more than lot=10,and

If I want to open a position with lot=10, then the next position will be reopened with lot=1.

The sequence of opening positions with increasing lot should be as follows:

1 position - lot=1
2 pose - lot=2
3 position - lot=3
4 position - lot=4
5 position - lot=5
6 position - lot=6
7 position - lot=7
8 posture - lot=8
9 position - lot=9
10 pose - lot=10

11 pose - lot=1
12 pose - lot=2

and so on.

the code itself to increase the subsequent lot is as follows:

     {
       if (Ballance!=0.0)
         {
           if (Ballance>AccountBalance())
               
       Lots=Lots+1;
                  else
             Lots=Lots+1+(!(Lots>1));   
         }
       Ballance=AccountBalance();
       }
 

Hello forum members.

I need to solve the following task:

To write ADX indicator values (namely: date (time), ADX value, DI+ value, DI- value) into a CSV file.

What is the best way to do it?