int totalorders=OrdersTotal();
I used your script above and it is working for me, but I'm also still using the old Build 186.
(I can't believe there are multiple builds of the same number).
(I can't believe there are multiple builds of the same number).
int totalorders=OrdersTotal();
totalorders is a variable which stores the value returned by OrderTotal().
I guess that the variable is assigned with 0 just once when the counter is zero. The code above gives no other chance to change it.
More than that the code has a condition that makes sure that the value of totalorders is printed only if either the variable or the counter (which assures that totalorders is 0 too) is equal to 0.
when the variable is instantiated, it is initialized to whatever OrdersTotal() returns. The counter has nothing to do with it since totalorders is initialized outside the if statement. The counter does not assume totalorders is 0. I don't know why that counter was even used, but it doesn't effect the totalorders variable. The only thing affected is the Print() function.
If the value returned is 0 when there is in fact an open order, than there is a problem. But when I run this code, it correctly returns the proper number of orders. But, like I said, I have the old Build 186.
If the value returned is 0 when there is in fact an open order, than there is a problem. But when I run this code, it correctly returns the proper number of orders. But, like I said, I have the old Build 186.
when the variable is instantiated, it is initialized to whatever OrdersTotal() returns. The counter has nothing to do with it since totalorders is initialized outside the if statement. The counter does not assume totalorders is 0. I don't know why that counter was even used, but it doesn't effect the totalorders variable. The only thing affected is the Print() function.
Correct!
Print outputs totalorders if it's 0 only.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Here is a script I created to test the OrdersTotal() function:
During testing after the buy position has been opened, the totalorders function still returns 0! Is there something I'm missing here?