Support Board
Date/Time: Tue, 04 Mar 2025 07:41:07 +0000
[Programming Help] - Using Multiple Spreadsheet in automated trading for 2 strategies
View Count: 686
[2021-11-30 15:09:44] |
User759427 - Posts: 2 |
Hi, I ll like to have a different strategy to automate my trading for the first 1 hour of the day and another strategy for the rest of the day. How do i do this? Thanks |
[2021-11-30 20:09:13] |
ForgivingComputers.com - Posts: 1021 |
Look here: Spreadsheet Systems, Alerts and Automated Trading: Limiting Trading to Certain Time Ranges
|
[2021-11-30 20:53:48] |
Sawtooth - Posts: 4179 |
If each strategy is relatively simple, you could use a group of Formula Columns for one strategy and another group for the second strategy. In the first group, put the entry signal for that group in its own Formula Column, and the same for the second group. Then, in K3/M3, reference each strategy's signal column in an IF statement that includes a time window for each, like this: =IF(AND(FRACTIME($J$41)>=TIME(09,30,00),FRACTIME($J$41)<TIME(10,30,00)),O3,IF(AND(FRACTIME($J$41)>=TIME(10,30,00),FRACTIME($J$41)<TIME(16,00,00)),U3,0)) where O3 is strategy 1 entry signal, and U3 is strategy 2 entry signal. If you are using L3/N3 for exits, you would have to replicate this for those signals. If each strategy is complex and needs more columns, or has other complex references that would conflict, you could use two instances of the Spreadsheet System for Trading study, each with its unique name. You could then control when it trades with a formula in each one's J28 cell. |
To post a message in this thread, you need to log in with your Sierra Chart account: