Author |
Topic: Placing Trailing Stop Order (6 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
RAnde Posts: 20 Joined: Sep 05, 2017 |
I have tried to place a Trailing Stop Order. But I got an exception "Invalid order part: ExtendedData" from OrderDraft.SendOrder. I see that I have to use the method "OrderDraft.SetTSData" to set values for properties "Reference" and "Delta".
#1 - Would you please explain how these properties is used in the Trailing Stop order process? In my application, the Trailing Stop order has a property that is used for the trailing stop distance. The system will calculate the stop price of order based on the last trade price of symbol and that trailing stop distance. E.g: If I place a trailing stop order for ESZ7, the currency trade price is 50. And I put the trailing stop distance is 5. So the trailing stop price will be 45. #2 - What properties of OrderDraft should I pass the trailing stop distance to? Is that OrderDraft.Price, Reference or Delta? I'm using your API in my application. And I'm getting stuck with Trailing Stop order. I didn't see any information that resolve my problem in your documentation. Please answer my question. |
||||
ETrifonov Posts: 63 Joined: |
Hello RAnde,
#1 Depending on order side (buy or sell), order will be modified to (+-Delta) price on market price become outside of (Reference +- Delta). #2 You send Trailing Stop order next way:
Evgeny
|
||||
RAnde Posts: 20 Joined: Sep 05, 2017 |
Hi ETrifonov
Thank you very much for replying my question. There is some points that I don't understand in your answer yet. #1 Depending on order side (buy or sell), order will be modified to (+-Delta) price on market price become outside of (Reference +- Delta) It means that the Trailing Stop Price of order will be modified by (+/-) Delta when market price becomes outside of (Reference +- Delta). #1 - Is my understanding correct? #1.1 - If so, in this case, Delta is the trailing stop distance. And depending on Delta and the current market price, system can calculate the trailing stop price. So why we have to input OrderDraft.Price here? #1.2 - If my understanding is correct, that Delta is the trailing stop distance, so why is Delta set to 0 in your example? The trailing stop distance (Delta) is 0, so the trailing stop price cannot be modified by it. Right? Edited by RAnde on Oct 31, 2017 09:41 PM |
||||
ETrifonov Posts: 63 Joined: |
Hi RAnde,
#1 Yes, your understanding correct, but with remarks below. #1.2 This because of minimal distance - one contract.TickSize. Delta will be used to calculate distance. For provided sample distance will be (Delta + contract.TickSize). And Trailing Stop Price will be modified by (+/-) Distance when market price becomes outside of (Reference +/- Distance). Sorry for confusing you. Evgeny
|
||||
RAnde Posts: 20 Joined: Sep 05, 2017 |
Hi ETrifonov
I understood about Reference and Delta. But I still don't understand about OrderDraft.Price. According to your answer, Trailing Stop order can work well with Reference and Delta. Why does it need OrderDraft.Price here? What is OrderDraft.Price used for? And thank you one again for helping me. |
||||
ETrifonov Posts: 63 Joined: |
OrderDraft.Price is Stop Price.
When market hit this price, order will be modified to Market Order. Evgeny
|
||||