For example:
It receives a sum of -2, and will open a short position for 2 contracts
Then it receives a sum of -1 and opens a third short contract
Then it receives a sum of 2 and closes two of the short contracts, leaving 1 short
Then it receives a sum of 3 and opens a long position for 2 (-1 + 3 = 2) contracts (this should automatically close the short position)
I get logging that shows it is in the code where it is doing a reversal, but the actual trade never happens -the existing position just remains.
Relevant code is attached; 152 lines seems a bit long to post inline.
No issues with opening a position, but I have seen problems with reversing and adding to position. Both of those are handled starting on line 136 [if (needsOpen) ].
It's my understanding that if call EnterLong() it will automatically close any short position and vice versa.
But the Enter calls do nothing, regardless of whether I am adding lots or reversing.
Also attached is a sample Log output from today.
Comment