logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
MS Support  
#1 Posted : Friday, July 28, 2017 10:44:11 PM(UTC)
Quote
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,355

Thanks: 24 times
Was thanked: 103 time(s) in 100 post(s)

Domenico D"Errico's article, “Daytrading with Night Volume”, expanded upon the standard first hour breakout system by adding a volume filter.  The article included an example chart with time sessions colored differently, a summation of the night time volume and a 5 day average of that volume.  Below are the formulas to create such a chart in MetaStock.  All the formulas assume you are using a 15 minute chart. 

Expert Advisor: 

These formulas can be used to color the bars with highlights and add buy and sell short symbols to the chart.

Highlights: 

Night Session (midnight to 8:30 AM)

Color: Black

Formula:

Code:
time:= (Hour()*100) + Minute();
time <= 830

First Hour (8:30 AM to 9:30 AM)

Color: Red

Formula:

Code:
time:= (Hour()*100) + Minute();
time <= 930 AND time > 830 

Main Session (9:30 AM to 3:15 PM)

Color: Blue

Formula:

Code:
time:= (Hour()*100) + Minute();
time <= 1515 AND time > 930

Evening Session (3:15 PM to midnight)

Color: Grey

Formula:

Code:
time:= (Hour()*100) + Minute();
time > 315

Symbols:

Buy signal:

symbol: up arrow

formula:

Code:
time:= (Hour()*100) + Minute();
night:= time <= 830;
nightvol:= If(night, Sum( If(night, V, 0), 36), 0);
avgnightvol:= 
(ValueWhen(1, time=830, nightvol)+ 
ValueWhen(2, time=830, nightvol)+
ValueWhen(3, time=830, nightvol)+
ValueWhen(4, time=830, nightvol)+
ValueWhen(5, time=830, nightvol))/5;
h1top:= ValueWhen(1, time=930, HHV(H,4));
ValueWhen(1, time=830, nightvol)>avgnightvol AND
time >930 AND time <=1445 AND H > h1top AND 
Ref(HighestSince(1, time=930, H),-1) <=h1top

Sell Short signal:

symbol: down arrow

formula:

Code:
time:= (Hour()*100) + Minute();
night:= time <= 830;
nightvol:= If(night, Sum( If(night, V, 0), 36), 0);
avgnightvol:= 
(ValueWhen(1, time=830, nightvol)+ 
ValueWhen(2, time=830, nightvol)+
ValueWhen(3, time=830, nightvol)+
ValueWhen(4, time=830, nightvol)+
ValueWhen(5, time=830, nightvol))/5;
h1bot:= ValueWhen(1, time=930, LLV(L,4));
ValueWhen(1, time=830, nightvol)>avgnightvol AND
time >930 AND time <=1445 AND L < h1bot AND 
Ref(LowestSince(1, time=930, L),-1) <=h1bot

Close all open positions:

symbol:  Exit sign

formula:

Code:
time:= (Hour()*100) + Minute();
closeout:= time >= 1515;
closeout AND Ref(closeout=0, -1)

Indicator:

The formula below will create an indicator that plots two lines.  After it has been added to the chart, change the lower line to a Histogram line style.  Then change the upper line to a dotted line and set the color to Red.

Night Session Volume:

Code:
time:= (Hour()*100) + Minute();
night:= time <= 830;
nightvol:= If(night, Sum( If(night, V, 0), 36), 0);
avgnightvol:= 
(ValueWhen(1, time=830, nightvol)+ 
ValueWhen(2, time=830, nightvol)+
ValueWhen(3, time=830, nightvol)+
ValueWhen(4, time=830, nightvol)+
ValueWhen(5, time=830, nightvol))/5;
nightvol;
avgnightvol

Quick Reply Show Quick Reply
Users browsing this topic
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.