PositionOpen Vs Buy?

 

Hello,

Im trying to understand trade function in the Ctrade class.

I don't get what is the difference between the Buy function and the positionOpen function.

I mean a Buy is to open a long position,  so for what is positionOpen?


Thank you.

 
yuv98 :

Hello,

Im trying to understand trade function in the Ctrade class.

I don't get what is the difference between the Buy function and the positionOpen function.

I mean a Buy is to open a long position,  so for what is positionOpen?


Thank you.


PositionOpen is a more general function - you can open both Buy and Sell and expose a pending order. Whereas the Buy function only opens a long position .

 

So why do we have the Buy if we can do it from the PositionOpen?

And for what we have the PositionClose? I mean if we open an opposite position with positonOpen its the same, isn't it?


Thank you!

 
yuv98:

So why do we have the Buy if we can do it from the PositionOpen?

...

Everyone acts as he likes. I, for example, like using Buy and Sell


yuv98:

...

And for what we have the PositionClose? I mean if we open an opposite position with positonOpen its the same, isn't it?

...

On the trading account with netting: it was BUY 1.0 lot. SELL 1.0 lot was opened. There are 0 lots.
On the trading account with a hedge: it was BUY 1.0 lot. SELL 1.0 lot was opened. Became the position # 1 BUY 1.0 lot and position # 2 SELL 1.0 lot.
 
Vladimir Karputov:

Everyone acts as he likes. I, for example, like using Buy and Sell


On the trading account with netting: it was BUY 1.0 lot. SELL 1.0 lot was opened. There are 0 lots.
On the trading account with a hedge: it was BUY 1.0 lot. SELL 1.0 lot was opened. Became the position # 1 BUY 1.0 lot and position # 2 SELL 1.0 lot.
Ok, Thanks!