
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
I am trying to make a function that determines if any open order is losing more money than a cutoff point (say, $-1000).
The function is then supposed to store the OrderTicket() and the OrderProfit() in two separate arrays, and exit with return (1) to signify that the cutoff point has been reached.
Before it stores the values in those arrays, it should check the OrderTicket() array to see whether this order is already filed.
If the OrderTicket number is already stored in the array, it is supposed to determine if the order has lost an ADDITIONAL $1000, and if so: replace value in the OrderProfit() array with a fresh value, and exit with return(1) to signify that a NEW cutoff point has been reached. If the order has not lost an additional $1000 (called Cutoff) then it should return(0) to signify that no order has lost an additional $1000.
I think I pretty much have it working (not sure??), but for some reason the array gets filled with a lot of '0' values along with the legitimate values. The output of the array is as follows:
The following is my actual code: