Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
automatically generate MOC orders for day trades
#1
HI Alex,

would it be posible to include a feature whereby any executed trades can be automatically exited with a MOC order ?
I'm looking at a day trading strategy which generates a bunch of limit orders prior to market open , for those that get filled during a session a MOC order is used to close them out. So currently the MOC generation is manual. ( but I'm asleep !)

part 2 of this request would be to incorporate a time setting where any unfilled orders are cancelled . For example I don't want a limit order to get filled 20 mins before close as it will be exited at close with a MOC
Not sure if your On-Trigger-expire feature takes car of this one ?

Do you think these 2 features are possible ?

thanks
Ivan
Reply
#2
Hi Ivan,

The RSN order type is what you're looking for -- they would only trigger if a position is filled and you can specify to close using MOC.
You can use On-Trigger Expiration to automatically cancel the RSN orders, but that is generally not necessary if your strategy only does what you described:
  - Place limit order
  - Close all positions MOC
Since the RSN orders won't do anything until you have a position.
https://aleratrading.com/forum/showthread.php?tid=132

You can use the Time in Force GTD to cancel those buy limit orders automatically
https://aleratrading.com/forum/showthread.php?tid=2
Reply
#3
thanks Alex ,

I will take a look at what you suggest 

regards
Ivan
Reply
#4
(03-13-2021, 08:52 AM)admin Wrote: Hi Ivan,

The RSN order type is what you're looking for -- they would only trigger if a position is filled and you can specify to close using MOC.
You can use On-Trigger Expiration to automatically cancel the RSN orders, but that is generally not necessary if your strategy only does what you described:
  - Place limit order
  - Close all positions MOC
Since the RSN orders won't do anything until you have a position.
https://aleratrading.com/forum/showthread.php?tid=132

You can use the Time in Force GTD to cancel those buy limit orders automatically
https://aleratrading.com/forum/showthread.php?tid=2

Hi

I am trying to do similar, place LMT orders to buy, and then sell with MOC.  I want to place the MOC orders straight after the LMT Buy orders, so I don't have to monitor the market.

I'm not sure how to make RSN MOC orders work, I think it may be the Signal ID that is the issue.  I am generating the signals using an Amibroker Exploration.  Does the Signal ID for each symbol need to be unique to that symbol and match the Symbol ID of the LMT order?  If so, any suggestions how to implement that in Amibroker?

J
Reply
#5
(12-01-2021, 01:26 AM)jason@daviscapital.com.au Wrote:
(03-13-2021, 08:52 AM)admin Wrote: Hi Ivan,

The RSN order type is what you're looking for -- they would only trigger if a position is filled and you can specify to close using MOC.
You can use On-Trigger Expiration to automatically cancel the RSN orders, but that is generally not necessary if your strategy only does what you described:
  - Place limit order
  - Close all positions MOC
Since the RSN orders won't do anything until you have a position.
https://aleratrading.com/forum/showthread.php?tid=132

You can use the Time in Force GTD to cancel those buy limit orders automatically
https://aleratrading.com/forum/showthread.php?tid=2

Hi

I am trying to do similar, place LMT orders to buy, and then sell with MOC.  I want to place the MOC orders straight after the LMT Buy orders, so I don't have to monitor the market.

I'm not sure how to make RSN MOC orders work, I think it may be the Signal ID that is the issue.  I am generating the signals using an Amibroker Exploration.  Does the Signal ID for each symbol need to be unique to that symbol and match the Symbol ID of the LMT order?  If so, any suggestions how to implement that in Amibroker?

J

The Signal ID should be unique per signal (that uses the signal ID), regardless of the symbol, i.e. RSN AAPL and RSN SPY need to have different Signal IDs. Note that you can reset signal IDs once they become large enough (by using a signal ID at least 10,000 less than the previous), see https://aleratrading.com/forum/showthread.php?tid=2

In Amibroker, I believe you can persist data using staticvarset https://www.amibroker.com/guide/afl/staticvarset.html OR you can use the time of day and the date to create an increasing signal ID (using unix time won't work since the signal ID is an integer).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)