"Day Trading With Night Volume" easylanguage

Questions about MultiCharts and user contributed studies.
Gibo887
Posts: 10
Joined: 16 May 2020
Location: Italy
Has thanked: 2 times
Been thanked: 1 time

"Day Trading With Night Volume" easylanguage

Postby Gibo887 » 05 Mar 2021

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
Attachments
TT-Tradestation.gif
(96.57 KiB) Not downloaded yet

User avatar
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

Postby TJ » 05 Mar 2021

See post #1 & post #2
viewtopic.php?t=11713

Gibo887
Posts: 10
Joined: 16 May 2020
Location: Italy
Has thanked: 2 times
Been thanked: 1 time

Re: "Day Trading With Night Volume" easylanguage

Postby Gibo887 » 05 Mar 2021

I'm very sorry :cry:

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 ;

Gibo887
Posts: 10
Joined: 16 May 2020
Location: Italy
Has thanked: 2 times
Been thanked: 1 time

Re: "Day Trading With Night Volume" easylanguage

Postby Gibo887 » 05 Mar 2021

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.


Return to “MultiCharts”