mlsignups Posted July 24, 2021 Report Share Posted July 24, 2021 (edited) One of my trading strategies is to enter stocks occasionally after hours; for instance SNAP this past week. To enter I need three characteristics; I need to know the news or earnings info; I need to see the right type of after hours price action and I want to see a high % of daily volume traded after hrs; normally at least 20% before I'd take an entry. Is it possible and if so can you give me some ideas on how to create an indicator that might display the after hrs volume % somewhere on the chart? Something like where the pace indicator displays. So if the stock averages 5M shares a day and after hours 1M shares have traded it would show 20%. Edited July 24, 2021 by mlsignups Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted July 24, 2021 Report Share Posted July 24, 2021 You can make a paintbar that would plot the % of after hour volume compared to regular hour volume. It would not show you a # but it would show a line with a scale. Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted July 24, 2021 Report Share Posted July 24, 2021 int DayNumber = -1; public void MainCalculation() { if (TradingDay.DayNumber != DayNumber) { CurrentState.AHVol = 0; CurrentState.RegVol = 0; DayNumber = TradingDay.DayNumber; } if (TradingDay.IsAfterHours) CurrentState.AHVol += BarVolume; else CurrentState.RegVol += BarVolume; SetColor("Line Color", SysColor.MainIndicator1); SetYValue(CurrentState.RegVol==0?0:CurrentState.AHVol*100/CurrentState.RegVol); } /// <summary> /// Is called at start of paintbar calculation, should be used to initialize anything needed for the paintbar /// </summary> private void PaintbarInitialize() { CurrentState.AHVol = 0; CurrentState.RegVol = 0; } /// <summary> /// Holds paintbar state - fill with variables needed to be preserved for next paintbar calc /// </summary> private struct PaintbarState { public double AHVol; public double RegVol; } /// <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 /// </summary> private void PaintbarClearState() { CurrentState = new PaintbarState(); } /// <summary> /// Saves paintbar state (called internally). /// </summary> private void PaintbarSaveState() { SavedState = CurrentState; } /// <summary> /// Restores paintbar state (called internally). /// </summary> private void PaintbarRestoreState() { CurrentState = SavedState; } In fact you can use the same paintbar as a scan - just set the SetScanResult as well as the SetYValue. Isn't MedvedTrader fun? 1 1 Quote Link to comment Share on other sites More sharing options...
mlsignups Posted July 26, 2021 Author Report Share Posted July 26, 2021 Thanks Mike; I'll take a look at it! Quote Link to comment Share on other sites More sharing options...
mlsignups Posted July 26, 2021 Author Report Share Posted July 26, 2021 I was able to see this on the chart; I think it's going to be great. And I think it may even be better as a scan result. if I'm watching a # of stocks during earnings after hrs; will be easier to see the ones that immediately jump to say 10% or 20% of normal volume as they are the ones that typically turn out most interesting. Thanks again. Quote Link to comment Share on other sites More sharing options...
mlsignups Posted July 27, 2021 Author Report Share Posted July 27, 2021 Hey Mike - works great as a scan result but I'm seeing like 8 digits to the right of the decimal. Is there a rounding function or some way to format the column to limit the # of digits? Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted July 28, 2021 Report Share Posted July 28, 2021 if the % variable is Per - return Math.Round(Per) - or if you want 2 digits (although, with percent, who cares?) - do Math.Round(Per, 2) Quote Link to comment Share on other sites More sharing options...
mlsignups Posted August 10, 2021 Author Report Share Posted August 10, 2021 Thanks. THis works great by the way. 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.