An "Open Range Breakout" system uses data up through today's close to determine a distance from tomorrow's opening price where it will either buy long or sell short. This is the strategy buy statement right out of one such system-
if MarketPosition = 0 then Buy ("Long") Next Bar at Open of Tomorrow + range Stop;
This works very well with historical data on both charts and in the Backtester. I tested it today when the market is closed. This statement produced an immediate live order. The order price was yesterday's open price plus the calculated offset. The symbol was 6AM0, the Australian Dollar on Globex. Now, the symbol dictionary tells me this contract is closed today, Saturday afternoon.
Can you explain 1) why this code put in a live order when the market was closed, and 2) what should be done to ensure that this strategy statement will work the same live as it does on history bars?
Thanks.
Automating an Open Range Breakout
- TJ
- Posts: 7774
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
always do live tests of your code on paper trading account before... 2) what should be done to ensure that this strategy statement will work the same live as it does on history bars?
Thanks.
going live on real money account.
All testing orders are done on paper trade accounts. Read closely, the problem is that MC produced a live order at a time when the contract's market was closed. In my view, this says that MC is ignoring the Session Times as defined in QuoteManager.always do live tests of your code on paper trading account before... 2) what should be done to ensure that this strategy statement will work the same live as it does on history bars?
Thanks.
going live on real money account.