i'm having an issue when closing my positions with exitlong/short function.
While the entries works fine as well as the exit on profit target or stop loss using the managed approach (setstoploss and setprofittarget), when i want to exit the position at a certain time using the ExitLong() ExitShort() function i get the following error
error 1: you do not have enough margin excess to place this order. Please deposit....
error 2: the strategy submitted an order that generate the following error "order rejected". Strategy has sent cancel request, attempted to close position and terminated itself.
It's strange because i do not have a margin issue with my position opened.
Can you please telle me what isthe problem?
Comment