Hello everyone, I found an interesting study on the web that would be right for my case. I am looking for an indicator (no automatic system), which indicates the volume between two precise moments, adds the volume and stops at the indicated time to resume the calculation the next day, perhaps accompanied by a simple average. I found this code for TS on the net, is anyone kind enough to adapt it to MC?
"Strategy: Overnight Volume Breakout
// Overnight Volume Strategy
// TASC JUN 2017
// Daytrading With Night Volume
// Domenico D'Errico
using elsystem ;
using elsystem.collections ;
inputs:
OverNightStartTime( 0 ),
OverNightEndTime( 830 ),
BreakoutStartTime( 830 ),
BreakoutEndTime( 930 ),
NoEntriesAfterTime( 1400 ),
VolumeAvgLength( 5 ),
VolRatioUP( 1 ) ;
variables:
double OverNightTotalVolume( 0 ),
double OverNightVolumeAverage( 0 ),
double FirstHourHigh( 0 ),
double FirstHourLow( 0 ),
bool OverNightVolTime( false ),
bool BreakoutRangeTime( false ),
vector OverNightVolume( null ) ; ;
once
begin
OverNightVolume = new vector ;
end ;
OverNightVolTime = ( OverNightStartTime
< OverNightEndTime and
Time >= OverNightStartTime and
Time <= OverNightEndTime ) or
( OverNightStartTime >
OverNightEndTime and
( Time >= OverNightStartTime or
Time <= OverNightEndTime ) ) ;
if not OverNightVolTime[1]
and OverNightVolTime then
begin
OverNightTotalVolume = ticks ;
end
else if OverNightVolTime then
begin
OverNightTotalVolume += ticks ;
end ;
if Time[1] < OverNightEndTime
and Time >= OverNightEndTime
and BarStatus( DataNum + 1 ) = 2
then
begin
if OverNightVolume.Count
>= VolumeAvgLength then
OverNightVolumeAverage =
Average( OverNightVolume,
VolumeAvgLength )
* VolRatioUP ;
OverNightVolume.insert( 0,
OverNightTotalVolume astype double ) ;
end ;"
Post a picture of what the indicator should be and the result.
I thank anyone who helps
"Day Trading With Night Volume" easylanguage
"Day Trading With Night Volume" easylanguage
- Attachments
-
- TT-Tradestation.gif
- (96.57 KiB) Not downloaded yet
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: "Day Trading With Night Volume" easylanguage
I'm very sorry
Code: Select all
inputs:
OverNightStartTime( 0 ),
OverNightEndTime( 830 ),
BreakoutStartTime( 830 ),
BreakoutEndTime( 930 ),
NoEntriesAfterTime( 1400 ),
VolumeAvgLength( 5 ),
VolRatioUP( 1 ) ;
variables:
double OverNightTotalVolume( 0 ),
double OverNightVolumeAverage( 0 ),
double FirstHourHigh( 0 ),
double FirstHourLow( 0 ),
bool OverNightVolTime( false ),
bool BreakoutRangeTime( false ),
vector OverNightVolume( null ) ; ;
once
begin
OverNightVolume = new vector ;
end ;
OverNightVolTime = ( OverNightStartTime
< OverNightEndTime and
Time >= OverNightStartTime and
Time <= OverNightEndTime ) or
( OverNightStartTime >
OverNightEndTime and
( Time >= OverNightStartTime or
Time <= OverNightEndTime ) ) ;
if not OverNightVolTime[1]
and OverNightVolTime then
begin
OverNightTotalVolume = ticks ;
end
else if OverNightVolTime then
begin
OverNightTotalVolume += ticks ;
end ;
if Time[1] < OverNightEndTime
and Time >= OverNightEndTime
and BarStatus( DataNum + 1 ) = 2
then
begin
if OverNightVolume.Count
>= VolumeAvgLength then
OverNightVolumeAverage =
Average( OverNightVolume,
VolumeAvgLength )
* VolRatioUP ;
OverNightVolume.insert( 0,
OverNightTotalVolume astype double ) ;
end ;
Re: "Day Trading With Night Volume" easylanguage
I would like the indicator to calculate the volumes, every day independently, between the close of the market (00:00 GMT +1) until the opening of the European cash market (09:00 GMT +1). I would need the moving average to monitor the result of the last day with x previous days. If it looked like the image posted above it would be great.