- ago
Hi there,

is there any possibility to include a condition on relative intraday volume? I mean buying when (besides others), the total volume so far today (from the session start until now) is X% higher than the average volume in the same time period of the Y previous sessions.

E.g. if the session starts at 9:30 and right now, it is 10:00, it would measure the total volume within these 30 minutes of trading and compare with the average value of trading volume within the same first 30 minutes in the last 50 days.

It would be used to implement a breakout strategy when the stock breaks out above a pre-selected pivot point.

BTW... is there any way to find that pivot point automatically using some kind of chart pattern analysis?

thx
Jiri
0
575
Solved
3 Replies

Reply

Bookmark

Sort
- ago
#1
QUOTE:
It would be used to implement a breakout strategy when the stock breaks out above a pre-selected pivot point.

BTW... is there any way to find that pivot point automatically using some kind of chart pattern analysis?

Start a new topic for this new question, please.
0
- ago
#2
QUOTE:
is there any possibility to include a condition on relative intraday volume? I mean buying when (besides others), the total volume so far today (from the session start until now) is X% higher than the average volume in the same time period of the Y previous sessions.

While I don't see a Blocks based option that exists you might want to give a go the indicator that @paul1986 has gracefully shared with the community? It could become the basis for a C# code strategy - or maybe even used with Blocks if saved as a Custom Indicator:

Total Volume for the day indicator
0
Glitch8
 ( 10.62% )
- ago
#3
Here is a coded Strategy that plots the average of the first 30 minutes of trading for the past 50 days onto the volume pane. It's intended to be run at 30-minute scale.

If you want to run the base Strategy at a more granular scale some changes would need to be made but it's still possible.

As far as automatically determining a pivot point, I'd need more clarity around what such a pivot point would look like.

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript1 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) {             //process on first complete minute bar             if (bars.IsFirstBarOfDay(idx))             {                //get average volume for first 30 minutes of trading over the past 50 days                int days = 1;                double sum = bars.Volume[idx];                for (int backIdx = idx - 1; backIdx >= 0; backIdx--)                {                   if (bars.IsFirstBarOfDay(backIdx))                   {                      days++;                      sum += bars.Volume[backIdx];                      if (days >= 50)                         break;                   }                }                if (days >= 50)                {                   double avg = sum / days;                   DrawDot(idx, avg, WLColor.Red, 4, "Volume");                }             } } else { //code your sell conditions here } } //declare private variables below } }

0
Best Answer

Reply

Bookmark

Sort