I need to program a simple indicator. For Meta Trader 4
The indicator should work on both Tick and minute charts. ( in MultiCharts it was implemented with 2 datas )
The idea is to print horizontal lines representing the opening lines of 3 sessions, the indicator should also contain a vwap on chart indicator (very simply calculation)
Notice that there should be inputs for the start and end of every range period : The start and end will always be in 1 mins resolution.
Session_1_Range_StartTime(1000),
Session_1_Range_EndTime(1015),
Session_2_Range_StartTime(1200),
Session_2_Range_EndTime(1215),
Session_3_Range_StartTime(1400),
Session_3_Range_EndTime(1415),
there should be control over the color and style of the lines of each and every session range lines.
The lines should end when the new lines begin
attached are images or how it should look,
This is the code for the VWAP indicator from MultiCharts :
If ( __On_Off_VWAP = 1 ) then
begin
Variables:
Sum_WeightedTicks(0),
SumTicks(0),
VWAP_Value(0),
Color(Yellow);
Currect_Session = CurrentSession(0);
if ( Currect_Session <> Currect_Session[1] ) Or
( ( Time > Session_1_Range_StartTime ) and ( Time[1] <= Session_1_Range_StartTime ) ) Or
( ( Time > Session_2_Range_StartTime ) and ( Time[1] <= Session_2_Range_StartTime ) ) Or
( ( Time > Session_3_Range_StartTime ) and ( Time[1] <= Session_3_Range_StartTime ) ) then
begin
Sum_WeightedTicks = 0;
SumTicks = 0;
end;
Sum_WeightedTicks = Sum_WeightedTicks + (Price * Ticks);
SumTicks = SumTicks + Ticks;
if ( SumTicks > 0 ) then
VWAP_Value = Sum_WeightedTicks / SumTicks
else
VWAP_Value = Price;
If ( VWAP_Value > VWAP_Value[1] ) then Color = Up_Color;
If ( VWAP_Value < VWAP_Value[1] ) then Color = Down_Color;
Plot1(VWAP_Value,"VWAP");
SetPlotColor(1,Color);
end;
The indicator should also contain day High Low lines ( there should be an input to turn them on and off)
the code should come as open code,
The project should not take more then 3-4 hours of programming.
Final indicator needs to look like the one suplied in the photos.