Only "Useful features from KimIV". - page 10

 
borilunad:

It's not hard to increase by one!

What do you mean?
 

ModifyOrder() function

Here is the beginning of the code:

void ModifyOrder(double pp=-1, double sl=0, double tp=0, color cl=CLR_NONE) {
  bool   fm;
  double op, pa, pb, os, ot;
  int    dg=MarketInfo(OrderSymbol(), MODE_DIGITS), er, it;
 
  if (pp<=0) pp=OrderOpenPrice();
  if (sl<0 ) sl=OrderStopLoss();
  if (tp<0 ) tp=OrderTakeProfit();

Initially, the formal parameters of the function look like this:

pp=-1, но sl=0 и tp=0

If we were to write clear and systematic, it would be easier for convenience to assign -1 to each of the formal parameters, i.e. that it would be like this:

pp=-1, sl=0 tp=0

The question arises, why confuse the code so much by comparing one of the formal parameters to zero, and the other to -1? We could have also entered -73...

 
hoz:

ModifyOrder() function

Here is the beginning of the code:

Initially, the formal parameters of the function look like this:

If we were to write clear and systematic, it would be easier for convenience to assign -1 to each of the formal parameters, i.e. that it would be like this:

The question arises, why confuse the code so much by comparing one of the formal parameters to zero, and the other to -1? We could have also entered -73...


Ask the author in person, and add one for 5 digits after the decimal point!
 

You can't (there's no point) modify an order with open price == 0, but you should be able to set zero stoploss and takeout, so if you put your mind to it (think), everything falls into place.

ZS. yes the functions were written back when the four digits were in place, but this does not invalidate their relevance.

 
borilunad:

Ask the author in person, and add a one for 5 digits after the decimal point!


With the number of digits after the decimal point it is easier to do so:

if(Digits==3 || Digits==5) pt=10*Point;
 
FAQ:

You can't (there's no point) modify an order with open price == 0, but you should be able to set zero stoploss and takeout, so if you put your mind to it (think), everything falls into place.

ZS. yes the functions were written back when the four digits were in place, but this does not invalidate their relevance.


You should be able to modify stoploss and takeprofit to zero, but stoploss or takeprofit should not be less than 0 and neither should the opening price, so -1 and 0 is just a formal parameter, and you can use it under any integer, as I understand it.
 
jurist70:

Dear, where in the line.


For all pairs except the yen pairs, the point is the change in the 4th digit of the quotes. For the yen pairs, it is in the second digit. With the introduction of quotation accuracy to 0.1 point, 5 and 3 digit quotations appeared.

 
hoz:

ModifyOrder() function

Here is the beginning of the code:

Initially, the formal parameters of the function look like this:

If we were to write clear and systematic, it would be easier for convenience to assign -1 to each of the formal parameters, i.e. that it would be like this:

The question arises, why confuse the code so much by comparing one of the formal parameters to zero, and the other to -1? We could have also entered -73.

pp= -1 is any opening price

if (pp<=0) pp=OrderOpenPrice(); this is a specific opening price

 
pako:

pp= -1 is any open price

if (pp<=0) pp=OrderOpenPrice(); this is the specified opening price


You should have read the question before answering it. I asked why the formal parameters have different default values. I think the point is that if we call the function without declaring sl and tp, they will default to 0. I.e. will not change.

I can't think of any other way to do it.

 
hoz:


You should have read the question before answering it. I was asking why the formal parameters have different default values. I think the point is that if we call the function without declaring sl and tp, they will default to 0. I.e. they won't change.

I can't think of any other way to do it.


In this case == 0, stop and take will be cleared. Actually, I cannot understand what all this fuss is about? It's not standard language functions, but wrappers written by one programmer, if you are not satisfied with them, then write your own, or change them as you see fit, and use them.