I'm having some trouble writing a signal of an intraday strategy. Basically I'd like to compare a value X (lets say Volume) of the Y bar in today session to the X value of the Y bar in the previous days session.
Or to phrase it another way.
If the Volume of today's 3rd bar of the session is greater than the volume of the 3rd bar of yesterdays session. Enter Long
etc...
My thought was to use "Bars.LastBarInSession" and increment a counter to keep track of the relative bars but that seems like a very sloppy way to solve the problem. Anyone have any other ideas?
Comparing Volume of bar today relative to yesterday
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Comparing Volume of bar today relative to yesterday
I think that, if you have a time based chart (so every day the same amount of bars), you can count the number of bars between today's bar and yesterday's bar with the same time. Then use `Bars.FullSymbolData.Ticks[x]` to get the volume from yesterday and compare it to the current bar.