Useful features from KimIV - page 123

 
artmedia70:

Igor's:

if (sy=="0") sy=Symbol();

Need:

if (sy==NULL) sy=Symbol();
As far as I understand, this is a useless substitution, because using NULL substitutes the current chart symbol.
 
Y.A.K._:
As far as I understand, this is a useless substitution, because using NULL substitutes the current chart symbol.
This may well be the case. Check it out. I saw where the "dog is in the code" in the function - I wrote it. But to dig in... I'm sleepy...
 
borilunad:
What don't you like? Or in this case you can only put one and the other is no good?!

Comment( NumberOfPositions(NULL, -1, Magic) );

in this case, we can put " " orSymbol() or _Symbolor 0, but not NULL

NULL in this case does not represent the current symbol

in this case, NULLmeans the current symbol

double res=iAC(NULL,0,1);

 
Yes, perhaps I am wrong in this context.
 
artmedia70:

The compiler used to allow all sorts of liberties. Now it's stricter. Is it bad? You look through the code and you see such pearls, even if you wanted to compare them to a missing value...

This is the end of the lafa. Why? Simply because, in particular, they make claims against meta quotas for that shit-code downloaded by users from all sorts of dumpsters. Schoolchildren write it, and freeloaders use it, not knowing that it is a bomb.

Igor is not a programmer to you?!
 
pako:

Comment( NumberOfPositions(NULL, -1, Magic) );

in this case, we can put " " orSymbol() or _Symbolor 0, but not NULL

NULL in this case does not represent the current symbol

in this case, NULLmeans the current symbol

double res=iAC(NULL,0,1);

So, Rita called not the indicator but the function in her own EA! Well, it's like a dog in a tree and a tree in a ... in the..."!
 
Y.A.K._:
As far as I understand, this is a useless substitution, because using NULL substitutes the current chart symbol.
That's for sure!
 
borilunad:
That's for sure!

No, not in that context.

If we were calling some built-in function that specifies a symbol, then yes, but here we are comparing with an order symbol, it cannot be NULL and will not give the truth when comparing NULL and OrderSymbol().

 
Y.A.K._:

No, not in this context.

If we were calling some inline function specifying a symbol then yes, but here we are comparing with an order symbol, it cannot be NULL and will not give the truth when comparing NULL and OrderSymbol().

I didn't say anything aboutOrderSymbol(), I only said that in Rita's case, if NULL was in the function call where I haveSymbol(), it doesn't matter. AndOrderSymbol() wasn't mentioned. It's just this site, everyone writes what they want. They may make a mistake.
 
borilunad:
Igor is not a programmer to you?!

Why not? The programmer. I like his logic, but that's how I would write the order counting function:

//+------------------------------------------------------------------+
int NumberTradesOrders(string sy, int op, int mn) {
   int num=0;
   for(i=OrdersTotal()-1; i>=0; i--) {
      if(OrderSelect(i,SELECT_BY_POS)) {
         if(OrderMagicNumber()!=mn) continue;   // для тестера можно удалить
         if(OrderSymbol()!=sy)      continue;   // для тестера можно удалить
         if(OrderType()!=op)        continue;
         num++;
         }
      }
   return(num);
}
//+------------------------------------------------------------------+