Hi,
I'd like to be able to run a "check" every 10 minutes to see what the current price is during a 1hr bar.
Is this possible at all?
Regards
Champski
Function which runs at set intervals during a 1hr bar
- TJ
- Posts: 7774
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
you can simply add a 10 minute chart to your window.Hi,
I'd like to be able to run a "check" every 10 minutes to see what the current price is during a 1hr bar.
Is this possible at all?
Regards
Champski
Sorry guys, I should have been more specific.
This is for automated trading. I use a 1hr chart and need to know what the price is after 50 minutes. If the price meets my condition(s) then I would like to enter a trade immediately. Normally I wait until the end of the bar to enter the trade but I'd like to find a way to enter 10 minutes early.
I had a look at using RecalcLastBarAfter(500) but I can't see that it's going to do what I need in this scenario.
Any assistance would be greatly appreciated.
Regards
Champski
This is for automated trading. I use a 1hr chart and need to know what the price is after 50 minutes. If the price meets my condition(s) then I would like to enter a trade immediately. Normally I wait until the end of the bar to enter the trade but I'd like to find a way to enter 10 minutes early.
I had a look at using RecalcLastBarAfter(500) but I can't see that it's going to do what I need in this scenario.
Any assistance would be greatly appreciated.
Regards
Champski
- TJ
- Posts: 7774
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
See post #4Sorry guys, I should have been more specific.
This is for automated trading. I use a 1hr chart and need to know what the price is after 50 minutes. If the price meets my condition(s) then I would like to enter a trade immediately. Normally I wait until the end of the bar to enter the trade but I'd like to find a way to enter 10 minutes early.
I had a look at using RecalcLastBarAfter(500) but I can't see that it's going to do what I need in this scenario.
Any assistance would be greatly appreciated.
Regards
Champski
[FAQ] Multiple time frame, Multi-Data Analysis
viewtopic.php?f=16&t=6929
TJ,See post #4Sorry guys, I should have been more specific.
This is for automated trading. I use a 1hr chart and need to know what the price is after 50 minutes. If the price meets my condition(s) then I would like to enter a trade immediately. Normally I wait until the end of the bar to enter the trade but I'd like to find a way to enter 10 minutes early.
I had a look at using RecalcLastBarAfter(500) but I can't see that it's going to do what I need in this scenario.
Any assistance would be greatly appreciated.
Regards
Champski
[FAQ] Multiple time frame, Multi-Data Analysis
viewtopic.php?f=16&t=6929
The only problem with this is that my system has been written for 1hr resolution. The link says you should always use the slower resolution as data2
eg. 1 min as data1, and 5 min as data2.
- TJ
- Posts: 7774
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
What you are really saying is...Sorry guys, I should have been more specific.
This is for automated trading. I use a 1hr chart and need to know what the price is after 50 minutes. If the price meets my condition(s) then I would like to enter a trade immediately. Normally I wait until the end of the bar to enter the trade but I'd like to find a way to enter 10 minutes early.
I had a look at using RecalcLastBarAfter(500) but I can't see that it's going to do what I need in this scenario.
Any assistance would be greatly appreciated.
Regards
Champski
You are trading a 60 min chart that ends at the 50th minute of every hour.
No, I'm trading a 60 minute chart and I usually wait until the end of the bar to see if my entry conditions are met so I can then go on to enter a trade at the start of the next bar.What you are really saying is...Sorry guys, I should have been more specific.
This is for automated trading. I use a 1hr chart and need to know what the price is after 50 minutes. If the price meets my condition(s) then I would like to enter a trade immediately. Normally I wait until the end of the bar to enter the trade but I'd like to find a way to enter 10 minutes early.
I had a look at using RecalcLastBarAfter(500) but I can't see that it's going to do what I need in this scenario.
Any assistance would be greatly appreciated.
Regards
Champski
You are trading a 60 min chart that ends at the 50th minute of every hour.
What I'd like to do is to enter the market a little earlier (10 minutes earlier than the end of the bar) in the event it appears "highly likely" that my usual entry conditions "would" be met. This would give me a 10 minute headstart on a trade that I would normally take anyway.
Does that make sense?
- JoshM
- Posts: 2196
- Joined: May 20 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Adding a second data series makes this needlessly complicated and resource intensive, I think. Why not do the following?No, I'm trading a 60 minute chart and I usually wait until the end of the bar to see if my entry conditions are met so I can then go on to enter a trade at the start of the next bar.
What I'd like to do is to enter the market a little earlier (10 minutes earlier than the end of the bar) in the event it appears "highly likely" that my usual entry conditions "would" be met. This would give me a 10 minute headstart on a trade that I would normally take anyway.
Does that make sense?
1. Calculate the time of next bar (current bar opening time + 60 minutes in your case),
2. Subtract 10 minutes from this,
3. Verify if the current tick time (IOG set to true) is greater than the value you got at step 2 but less than the value at step 1.
4. As long as step 3 evaluates to true, keep submitting the orders in that 10 minute time window (in other words, only submit orders when step 3 is true).
See the Date and time reserved words to get you started.
I like this idea but I have had a look at the date and time routines and am not sure how to code this.Adding a second data series makes this needlessly complicated and resource intensive, I think. Why not do the following?No, I'm trading a 60 minute chart and I usually wait until the end of the bar to see if my entry conditions are met so I can then go on to enter a trade at the start of the next bar.
What I'd like to do is to enter the market a little earlier (10 minutes earlier than the end of the bar) in the event it appears "highly likely" that my usual entry conditions "would" be met. This would give me a 10 minute headstart on a trade that I would normally take anyway.
Does that make sense?
1. Calculate the time of next bar (current bar opening time + 60 minutes in your case),
2. Subtract 10 minutes from this,
3. Verify if the current tick time (IOG set to true) is greater than the value you got at step 2 but less than the value at step 1.
4. As long as step 3 evaluates to true, keep submitting the orders in that 10 minute time window (in other words, only submit orders when step 3 is true).
See the Date and time reserved words to get you started.
Does anyone know how to add and subtract time (which will work with live and historical data?)
eg.
Code: Select all
Condition1 = Time of previous bar + 50 minutes
If currenttimeonchart = condition1 then enter a trade
- JoshM
- Posts: 2196
- Joined: May 20 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
You need to convert it to DateTime first to get accurate calculations (see ELTimeToDateTime).I like this idea but I have had a look at the date and time routines and am not sure how to code this.
Does anyone know how to add and subtract time (which will work with live and historical data?)
eg.Code: Select all
Condition1 = Time of previous bar + 50 minutes
If currenttimeonchart = condition1 then enter a trade