API Support Forum
OEC API > Order Execution > TrailingStopData.ReferencePrice vs OrderDraft.Price
Author Topic: TrailingStopData.ReferencePrice vs OrderDraft.Price
(4 messages, Page 1 of 1)
Moderators: VPfau
eo707
Posts: 68
Joined: Nov 08, 2011


Posted: Dec 14, 2011 @ 06:45 AM             Msg. 1 of 4
When you set a trailing stop you have price and reference price. What is what for?

will consider one number as one tick, or pip.
I will give an example for a scenario:
You buy long at 10, you wish to keep distance of 5 ticks, and you want it to be updated each tick the market moves.

From the time you bought, the price went down to 9.
So you wish to set a 5 point distance (from 10 which is your purchase),
so you will set the stop price (I guess it is the OrderDraft.Price) to 5.
Then you send the request to the server, the price is 9, you asked to have a trailing stop at 4, technically you will have 4 points distance.

I have understand that the Delta is when the market moves at Delta steps, then update my trailing stop. But, where do you set the distance from the market price??

With the example above, if the market went with you, there is no problem. but if the market went against you, you want to keep your looses based on your filled position and not always by the current market price...

Dose the TrailingStopData.ReferencePrice is there for it?

Can you explain more??? Your documentation is laconic and your forum is not always get responses and not so active....
please provide more... we are your clients. and bottom line applications that built against your objects, will give you more business.

Thank you.
EO
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Dec 14, 2011 @ 01:51 PM             Msg. 2 of 4
Please consider Reference price as a trigger price when to start trailing. So, if Reference price will be equal market price, trailing logic will be started immediately.

You can find out more details about trailing stops here: http://www.openecry.com/cfbb/index.cfm?page=topic&topicID=532

Victor Vins
Lead Software Developer
eo707
Posts: 68
Joined: Nov 08, 2011


Posted: Dec 15, 2011 @ 05:37 PM             Msg. 3 of 4
Thank you Victor,
Each time I ask a question, after a while I get the answer and I have my next question. I believe that it is normal.

I understood that there is an OSO type of order.
I am still on the strategy of the trailing stop.
I made one order, then on the OnOrderFilled, I call the reversed order with the trailing stop. I think I got it all.

But, When the trailing stop got filled, the OnOrderFilled execute again (I had the behave that many TS orders got filled).

I am thinking to use the OSO order.

Can you refer me to where I can find it?
How do I set it?
The lines of code?


I understand that the order get started with OrderDraft.
The only place (in OrderDraft), is in ExtData which derived the Child Order.

Can you give me points?

Thank you.
eo
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Dec 16, 2011 @ 12:01 PM             Msg. 4 of 4
Hello,

you need to use http://www.openecry.com/api/api/OEC.API.OECClient.SendLinkedOrders.html to place OSO orders. Your TrailingStop order will be "linked" there.

Victor Vins
Lead Software Developer