Profile Picture

Sell at limit order

Posted By Jones 10 Years Ago
Message
Posted Sunday June 03 2007
Hi,

This seems a dumb question to ask, but I havent been able to find a reference in documentation or an example strategy that does it.

How do I do a sell at limit in c#?

I can see OpenPosition() can have an order type of limit, but ClosePosition() is at market only.

Posted Sunday June 03 2007
The simplest way to do this is with a profit target.  You can set a global default profit target level in the system properties.  You can also modify the profit target of an open position with the PositionManager.SetProfitTarget method.

To submit an arbitrary order for a position, use the PositionManager.AddToPosition or PositionManager.RemoveFromPosition methods.

Thanks,
Daniel

DoQ
Supreme Being (12,615 reputation)Supreme Being (12,615 reputation)Supreme Being (12,615 reputation)Supreme Being (12,615 reputation)Supreme Being (12,615 reputation)Supreme Being (12,615 reputation)Supreme Being (12,615 reputation)Supreme Being (12,615 reputation)Supreme Being (12,615 reputation)
Posted Friday June 29 2007
I agree. It took me a while to figure this out also. Intuitively, ClosePosition() should be used as the opposing transaction to OpenPosition(). I think OrderType should be included and let the user choose market or limit or stop limit etc... I finally gave up searching and used RemoveFromPosition and passed it all shares. It would be nice to see Remove/Add to/from Position to be used for pyramiding or scaling out, or even exiting entirely but logically ClosePosition() comes to mind first for doing just that.

Just a thought for future users searching for the same thing.Smile

thx


DoQ_Indicators
"better is the enemy of good enough"

Edited: Friday June 29 2007 by DoQ


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems