int numberOfContracts = accountSupports;
if (longCondition) {
EnterLong(numberOfContracts, "")
}
The first time this enters a trade, the correct quantity is entered, say 1. The next time it enters a trade, it enters a quantity of 2 even if the value of accountSupports is still only 1. The third time it enters, it will use quantity of 3, despite accountSupports still being 1.
I have confirmed that the value of numberOfContracts is correct by printing the current value to the output log immediately before calling EnterLong, and despite it being set at 1 on each execution, the quantity for each entry appears to be accumulative.
I've confirmed this by manually setting the "numberOfContracts" to 1, in which case each subsequent trade quantity goes up by 1, and then setting it to 2, in which case each subsequent trade goes up by 2.
Is there something that my code needs to handle differently, or is this a bug?
I would have expected that if I hardcode this value to say 2, that every trade enters a quantity of 2. Any suggestions?
Comment