I want to refer to the today’s open price. How to manage it to get and hold the open of the first bar of a trading session as a usable constant for further usage even if new intraday (=“intrasession“) bars occur? All other than daily bars will replace the open price every new bar.
Example: Trading session starts 09:00 (opening of the first minute – e.g. – bar), open of first bar is 1.5000. At 14:53 conditions are met and Long-Entry should be at open of first bar (= 1.5000) - 10 pips limit = 1.4990.
BTW: opend(0) is not what I need – it delivers yesterdays open, I need today’s open.
Many thanks for any help !
Todays Open Price
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Dear Dave,
thank you - you are right, but my experience was:
Todays open is delivered by opend(0) not until the second intraday bar of today occurs. So you can’t trade the open of the first bar (e.g. minute) of a new session referencing this open with a limit order e.g. You have to wait until the second bar occurs and from then on you can use the new days open (which is indeed that one of the first not the second bar) all day long.
In my case problem is done anyhow. Many thanks again!
thank you - you are right, but my experience was:
Todays open is delivered by opend(0) not until the second intraday bar of today occurs. So you can’t trade the open of the first bar (e.g. minute) of a new session referencing this open with a limit order e.g. You have to wait until the second bar occurs and from then on you can use the new days open (which is indeed that one of the first not the second bar) all day long.
In my case problem is done anyhow. Many thanks again!
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Dear Dave,
If you use this code (I checked it again and it stays true):
buy 1 contract next bar at opend(0) – 20 points limit ;
on a minute chart before session starts you will have to wait until the second bar occurs until your trade is submitted (at the open price of the first bar, not the second).
How to modify the code to trade the first bar as you suggest – if I understood you right?
Many thanks.
If you use this code (I checked it again and it stays true):
buy 1 contract next bar at opend(0) – 20 points limit ;
on a minute chart before session starts you will have to wait until the second bar occurs until your trade is submitted (at the open price of the first bar, not the second).
How to modify the code to trade the first bar as you suggest – if I understood you right?
Many thanks.
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times