Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
order - close position by time condition
does it possible to create an order of closing position if some time passed?
I'm trying to create an order with 3 limits, take profit, stop loss, and time threshold. Let's say the order is "buy", if the price does up and hits some limit, take profit, if the price went down and hits some limit, stop loss and if nothing happens for a certain time, close the position.? [I took it from? "advanced machine learning in finance" by Lopez] |
Nick
¿ªÔÆÌåÓýIt seems like "good after time" would work for that. On 12/16/2020 6:56 PM,
refael.lasry@... wrote:
does it possible to create an order of closing position if some time passed? |
Yes - create a parent order to enter the position, with 3 child orders to exit it: a take-profit order, a stop-loss order, and the timeout-exit order. All child orders should have the same OCAGroup so that one-cancels-all; the timeout order can be a regular sell/but @MKT order with a GoodAfterTime parameter that you can set to your required timeout so that it only gets active after the specified time.
As an alternative to using GoodAfterTime, some traders use a regular @MOC order (without a GoodAfterTime value), which only becomes active during the market close session (as dictated by the MOC mechanism). |
Does your GAT get rejected when you place the orders? In that case you might want to check your code again,
toggle quoted message
Show quoted text
Just tried a bracket plus GAT and it placed without an error or warning (though markets are closed). On Sat, Jul 24, 2021 at 04:06 PM, <refael.lasry@...> wrote:
|
I don't do Python and my code heavily relies upon our Java framework. So it won't help you.
toggle quoted message
Show quoted text
Looking at your code a few things come to mind:
On Sat, Jul 24, 2021 at 11:30 PM, <refael.lasry@...> wrote:
my code (which not working):? |
to navigate to use esc to dismiss