Support Board
Date/Time: Thu, 23 Jan 2025 04:57:29 +0000
Post From: Totaling Volume using ACSIL During Replay Mode
[2018-11-04 09:25:04] |
Yoda - Posts: 106 |
I'm creating an ASCIL study that sums volume between midnight and 08:30 a.m. When I first apply the study to a chart (what I refer to as "non-replay mode"), it correctly calculates the volume. However, it doesn't work during Accurate Trading System Back Test Replay Mode (with tick data). Let's say we have a 15 min bar with 3 trades each with volume of 300 (for a total of 900 for the bar). To retrieve the overnight volume I'm using: NightlyVolumePersist += Volume[sc.Index];
In non-replay mode, Volume[sc.Index] pulls the volume of each candle (so 900 in the above example) and correctly assigns the 900 to NightlyVolumePersist. However, in replay mode, Volume[sc.Index] is returning the following volume figures: 300 600 900 Therefore the NightlyVolumePersist variable is now showing total volume for the 15 min candle of 1,800 (300 + 600 + 900). Can anybody help me and suggest code that I need to use that will work both in replay and non-replay mode? |