Is there a way to detect that the daily bar will close in 1 minutes, then calculate the daily rsi indicator and if the indicator is less than 20 buy before the close?
Maybe there are better way's but what I can think of:
Have AB run with real time data, on daily bars
Start a batch 1 min before the close
In the batch run your system
Think that should do what you want. (ofcourse you understand your signal might be different at the end of the day)
Another way would be to calculate the value needed for the RSI signal and check for that. You would then have a "trigger value" that you could, depending on your broker, use for a timed order.
Also note, you will need <= 1min data to actually backtest this.
There are other ways to predict your signal, such as pre-calculating the price that would cause RSI to be under 20, then place a limit on close order at that price. You could even place this order the night before if you wanted.
I actualy wanted to suggest the same thing Pinecone suggests but did not want to complicate it to much
What I would do in that case is actualy place the orders 1 minute before the market closes.
What you can do with interactive brokers is send your orders to them and have them active 1 minute (or 10 seconds or any time you choose) before the market closes. You could place a market buy order at your limit price (the one calculated to trigger the RSI) or better.
If your broker is fast enough... you could actualy run that 1 second before the close "guaranteeing" you a trade price very close to the actual closing price.
Edit: See that I actualy suggested it but not with to many words
I didn't know about the limit on close orders. Yes, I will try this method I can send them when the daily bar begins.
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.