Forum

I need help to figure out how to close all my positions.

string symbol = Symbol (); ulong deviation = ULONG_MAX ; if (PositionClose(symbol, deviation){ Print ("Position for symbol ", symbol, " closed successfully"); } else { Print ("Error closing position for symbol ", symbol, ". Error code:", GetLastError ()); } I

How to write the code to close positions

I have been having a lot of difficulty trying to write the code needed to close all of the positions I am in if a certain signal appears . Here is the code that I have within my method: string symbol = Symbol (); ulong deviation = ULONG_MAX ; if (PositionClose(symbol, deviation){ Print