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
Hello everyone,
I use a function to calculate the optimal lotsize for any trade, the return value is as seen below. This function is supposed to deliver a 0.XX double so that the OrderSend function can properly open an order.
In the main code, I call the function twice to recieve two lotsizes, one small and one big, 0.25 percent and 0.75 percent respectively.
I add these two together and save them in the global variable "Lots", which I then use to open the order using OrderSend().
The whole idea of this LotsSmall and LotsBig splitting is that I take the LotsBig portion off at a certain distance and then let the LotsSmall portion run. I select a trade, then filter using use OrderLots()==Lots and then use OrderClose to close the LotsBig portion.
This seems to work about 95% of the time. However sometimes it does happen that the order is not recognized by OrderLots()==Lots even though the OrderSend(...,Lots,... ) was just placed one tick before. Does anyone have an idea why this happens sometimes?