View Single Post
  #1 (permalink)  
Old 03-18-2007, 12:08 AM
saadei's Avatar
saadei saadei is offline
Junior Member
 
Join Date: Nov 2005
Posts: 7
saadei is on a distinguished road
Pivot Points (like a Dots)

Hello.

I have used by some time the VTtrader due to the facility that it has for people with little knowledge on programming, as it is my case. But because that platform is much very slow, at the moment I am migrating my chart configurations towards the MT4, that of step is saying, seems to me an excellent platform, unless it demands much period of learning for people like me to be able to program it.

In the forum "Visual Trading Systems ", I requested help to program pivot points like DOTS, sights single in the right side of the charts. The only object of this indicator is to let the space of the prices to be able free to use it with other indicators. With the excellent help there from Chris, we obtain the following indicator:

************
Input:
StartHour
StartMnute
DisplayMidLevels
HD
shift

Output:
Resistance3
ResistanceMidLevel3
Resistance2
ResistanceMidLevel2
Resistance1
ResistanceMidLevel1
PivotPoint
SupportMidLevel1
Support1
SupportMidLevel2
Support2
SupportMidLevel3
Support3


Program:
_BarCount:= cum(1);

CalculateLookBackPeriods:= Barssince(hour()=StartHour and Minute()=StartMinute);
LookBackPeriods:= valuewhen(1, Cross(0.5,CalculateLookBackperiods), ref(CalculateLookBackPeriods,-1));

H1:= valuewhen(1, Hour()=StartHour AND minute()=StartMinute, HHV(H,LookBackPeriods));
L1:= valuewhen(1, Hour()=StartHour AND minute()=StartMinute, LLV(L,LookBackPeriods));
C1:= valuewhen(1, Hour()=StartHour AND minute()=StartMinute, C);

IndicatorDisplay:= if(_BarCount>=(2*LookBackPeriods), 1, 0);
PeriodLIVE:= if(HD=1,1,_BarCount);

PivotPoint:= if(IndicatorDisplay=1, (H1+L1+C1)/3, null);

Resistance1:= if(IndicatorDisplay=1, 2 * PivotPoint - L1, null);
Resistance2:= if(IndicatorDisplay=1, PivotPoint + (H1-L1), null);
Resistance3:= if(IndicatorDisplay=1, 2 * PivotPoint + (h1-2*L1), null);

Support1:= if(IndicatorDisplay=1, 2 * PivotPoint - H1, null);
Support2:= if(IndicatorDisplay=1, PivotPoint - (H1-L1), null);
Support3:= if(IndicatorDisplay=1, 2 * PivotPoint - (2*H1-L1), null);

ResistanceMidLevel1:= if(IndicatorDisplay=1 AND DisplayMidLevels=0, (PivotPoint+Resistance1)/2, null);
ResistanceMidLevel2:= if(IndicatorDisplay=1 AND DisplayMidLevels=0, (Resistance1+Resistance2)/2, null);
ResistanceMidLevel3:= if(IndicatorDisplay=1 AND DisplayMidLevels=0, (Resistance2+Resistance3)/2, null);

SupportMidLevel1:= if(IndicatorDisplay=1 AND DisplayMidLevels=0, (PivotPoint+Support1)/2, null);
SupportMidLevel2:= if(IndicatorDisplay=1 AND DisplayMidLevels=0, (Support1+Support2)/2, null);
SupportMidLevel3:= if(IndicatorDisplay=1 AND DisplayMidLevels=0, (Support2+Support3)/2, null);

PivotPoint:= ref(if(REF(C,PeriodLIVE)=NULL,PivotPoint,NULL),shi ft);

Resistance1:= ref(if(REF(C,PeriodLIVE)=NULL,Resistance1,NULL),sh ift);
Resistance2:= ref(if(REF(C,PeriodLIVE)=NULL,Resistance2,NULL),sh ift);
Resistance3:= ref(if(REF(C,PeriodLIVE)=NULL,Resistance3,NULL),sh ift);

Support1:= ref(if(REF(C,PeriodLIVE)=NULL,Support1,NULL),shift );
Support2:= ref(if(REF(C,PeriodLIVE)=NULL,Support2,NULL),shift );
Support3:= ref(if(REF(C,PeriodLIVE)=NULL,Support3,NULL),shift );

ResistanceMidLevel1:= ref(if(REF(C,PeriodLIVE)=NULL,ResistanceMidLevel1, NULL),shift);
ResistanceMidLevel2:= ref(if(REF(C,PeriodLIVE)=NULL,ResistanceMidLevel2, NULL),shift);
ResistanceMidLevel3:= ref(if(REF(C,PeriodLIVE)=NULL,ResistanceMidLevel3, NULL),shift);

SupportMidLevel1:= ref(if(REF(C,PeriodLIVE)=NULL,SupportMidLevel1,NUL L),shift);
SupportMidLevel2:= ref(if(REF(C,PeriodLIVE)=NULL,SupportMidLevel2,NUL L),shift);
SupportMidLevel3:= ref(if(REF(C,PeriodLIVE)=NULL,SupportMidLevel3,NUL L),shift);

************

I would like to know if some programmers seems it indicator interesting, of such form that to write it in MQL language and leaving it to disposition of all. If it is possible to write it in MQL, somebody could help to do it?

Note: The indicator must be able to use in all the timeframes.


Thanks in advance.

Saludos.
Attached Images
File Type: gif Dot-PivotPoints.GIF (33.4 KB, 2364 views)
Reply With Quote