Roger Posted March 16, 2022 Report Share Posted March 16, 2022 Hello, I see Prev Vol as a column in the portfolio, but where is when I create scans? And what is SymbolData.Volume24 ? Thanks for your help. Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted March 17, 2022 Report Share Posted March 17, 2022 I didn't expose that value because not all feeds have that data... Volume24 is for crypto. It is the volume in the previous 24 hours. Constantly changes. Quote Link to comment Share on other sites More sharing options...
Roger Posted March 17, 2022 Author Report Share Posted March 17, 2022 Ok, I will try to calculate Prev Vol with TimeStamp code. Also, can you check the settings for Alert Parameter Note: DayRange and DayRange %. It appears to be incorrect data. Thanks, Roger Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted March 18, 2022 Report Share Posted March 18, 2022 DayRange would show you DayHigh - DayLow. What does it show for you? Quote Link to comment Share on other sites More sharing options...
Roger Posted March 18, 2022 Author Report Share Posted March 18, 2022 I thinks it works ok, discovered dxfeed does not provide Day Range or Range Percentage in PreMarket. I was trying to get that in Premarket scan alerts Notes, but it was just showing Last and 0. Also can you give me hint on coding for Previous Volume? I am using dxfeed and it has Prev Vol available. Having difficulty in getting any data from a specific Timestamp. Thanks, Roger Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted March 18, 2022 Report Share Posted March 18, 2022 You can calculate previous day's volume as follows (in Advanced mode). In the following CurrentState.PrevDayVolume always holds the previous day's volume. The bolded parts in the below code are the parts that are different from the standard template state code that is generated automatically in advanced mode. public void MainCalculation() { if ( CurrentState.DayNumber != TradingDay.DayNumber ) { CurrentState.PrevDayVolume = CurrentState.TodayVolume; CurrentState.TodayVolume = 0; CurrentState.DayNumber = TradingDay.DayNumber; } CurrentState.TodayVolume += BarVolume; } /// <summary> /// INITIALIZES paintbar. Is called at start of paintbar calculation, should be used to initialize anything needed for the paintbar /// NOTE: do NOT initialize the CurrentState here - the PaintbarClearState will be called AFTER this call, and will wipe it out. /// </summary> private void PaintbarInitialize() { } /// <summary> /// Holds paintbar state - fill with variables needed to be preserved for next paintbar calc /// </summary> private struct PaintbarState { public double PrevDayVolume; public double TodayVolume; public int DayNumber; } /// <summary> /// Holds current PB state - use to calc PB, changes to it carry over to next PB calc /// </summary> private PaintbarState CurrentState; /// <summary> /// Holds saved PB state - internal /// </summary> private PaintbarState SavedState; /// <summary> /// Is called at start of paintbar calculation, should be used to clear the paintbar state /// and initialize whatever variables you place into it. This is called AFTER PaintbarInitialize /// </summary> private void PaintbarClearState() { CurrentState = new PaintbarState(); CurrentState.DayNumber = -1; } /// <summary> /// Saves paintbar state (called internally). /// </summary> private void PaintbarSaveState() { SavedState = CurrentState; } /// <summary> /// Restores paintbar state (called internally). /// </summary> private void PaintbarRestoreState() { CurrentState = SavedState; } Quote Link to comment Share on other sites More sharing options...
Roger Posted March 23, 2022 Author Report Share Posted March 23, 2022 Mike, thanks for your assistance. Roger Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.