Hi,
I’d like to close part of the pocition. Eg. the opened position = 1 LOT. And I would like to close 0.7 LOT.
I am using the function PositionClosePartial, but it does not work for me.
Maybe because of the last parameter “Deviation”, as I could not find what are the units of deviation (But I have tried to increase the deviation to the really huge number and it didn’t helped). Or from another reason, but I don’t know why.
Please could you help?
CPositionInfo m_position;
CTrade m_trade;
int OnInit()
{
for(int i=PositionsTotal()-1;i>=0;i--)
{
if(m_position.SelectByIndex(i))
{
if(m_position.Symbol()==Symbol())
{
m_trade.PositionClosePartial(m_position.Ticket(),0.1,20);
}
}
}
}