PureBytes Links
Trading Reference Links
|
Using Midas concept can be a pain in the
butt so I wrote an indicator
which first picked all possible pivots
(turning points) where a Midas
line might start and then allowed the user
to select the point at
which to start a Midas line by entering the
number of the pivot.
See attached Junk1.gif for this
type of application.
I have highlighted the numbers that are
used to input to the routine
to plot the lines. Remember, put the
indicator on and let it
number pivots and then update inputs with
pivot numbers you want
to use.
An .ela is attached since you
need my Swing_Lee function to
pick the pivots.
Hope you have fun with this.
Clyde
<FONT face="Courier New"
size=2>{$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Indicator:
Auto_Midas
Author: Clyde
Lee, Copyright by C. Lee/SYTECH Corporation 2001
Purpose: Provide
method to plot support lines using midas
principal from selected (or ALL) pivot points.
<FONT face="Courier New"
size=2>
Initially run with TypAnal input set to Zero to generate
pivot numbers for use in setting up points or run
with.
Pivot numbers will be posted on the chart at each
pivot
(turning) point found for the length of pivot
you
input.
<FONT face="Courier New"
size=2>
Once the pivot points are established and labeled
then
you simply enter the pivot numbers to start a
Midas
line. Note that the indicator is capable of
finding
the proper direction of the line from the pivot #.
<FONT face="Courier New"
size=2>
Up to 4 specific pivot numbers can be input if you want
limited number of lines. Simply input pivot number to
S1Pvt (or S2/S2/S4).
<FONT face="Courier New"
size=2>
For auto detection set TypAnal to 1 (for support lines)
or
2 (for resistance lines). In such a case the
indicator will start a new Midas line at each
new
pivot.
<FONT face="Courier New"
size=2>
This indicator makes use of the UpTicks and
DnTicks
functions to determine the summation direction.
<FONT face="Courier New"
size=2>$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}
input: Len4Pvt(34), {Length for
use in SwingLee to calculate pivots}
TypAnal(1), {Set 0=normal run 1=support
2=resistance }
S1Pvt(0), {Pivot number where to start
S1/R1
}
S2Pvt(0), {Pivot number where to start
S2/R2
}
S3Pvt(0), {Pivot number where to start
S3/R3
}
S4Pvt(0); {Pivot number where to start
S4/R4
} Var: VolMult(1); {Volume multiplier
to establish proper lines }
Var:
AvgPrice((H+L)/2),TempV(0),PVValue(0),Vmult(VolMult),TempM(0);Array:
MidasSet[4](0),SnPvt[4](0),
MIDAS[4](AvgPrice),
cumpv[4](0),cumv[4](0);var:
KntHigh(0),KntLow(0),BackBars(0),
Direct(0),String1(""),
HLPrice(0),DoInit(True); If DoInit then begin
SnPvt[1]=AbsValue(S1Pvt); SnPvt[2]=AbsValue(S2Pvt);
SnPvt[3]=AbsValue(S3Pvt); SnPvt[4]=AbsValue(S4Pvt); If
VolMult<=0 then VMult=1;End;
AvgPrice=(H+L)*.5;If UpTicks>0 then
TempV=UpTicks+DownTicks elseIf V>0 then TempV=V else TempV=1;If
VolMult<0 then TempV=-VolMult;
PVValue=AvgPrice*Vmult*TempV;For
Value2=1 to 4 begin cumpv[Value2]= cumpv[Value2] + PVValue;
cumv[Value2] = cumv[Value2] + TempV; MIDAS[Value2]=
cumpv[Value2]/cumv[Value2];End;
Direct=Swing_Lee(Len4Pvt);
If Sign(Direct)<>Sign(Direct[1]) then
begin BackBars=AbsValue(Direct);
If direct<0 then
begin KntHigh=KntHigh+1;
HLPrice=H[BackBars]; End Else begin
KntLow =KntLow +1; HLPrice=L[BackBars];
End;
If TypAnal=0 then
begin
String1=NumToStr(KntHigh+KntLow,0);
Value96=Text_New(Date[BackBars],Time[BackBars],HLPrice,String1);
If Direct<0 then Text_SetStyle(Value96, 2,
1) Else
Text_SetStyle(Value96, 2, 0); End;
If S1Pvt<>0 and TypAnal=0 then
begin For Value2=1 to 4
begin If KntHigh+KntLow=SnPvt[Value2] then
begin
MidasSet[Value2]=1; cumpv[Value2]=
0{HLPrice}; cumv[Value2] =
0; MIDAS[Value2]=
HLPrice; For Value1=BackBars
DownTo 0 begin If
Value1>0 then
begin If
Value2=1 then
Plot1[Value1](MIDAS[1],"MDS1");
If Value2=2 then
Plot2[Value1](MIDAS[2],"MDS2");
If Value2=3 then
Plot3[Value1](MIDAS[3],"MDS3");
If Value2=4 then
Plot4[Value1](MIDAS[4],"MDS4");
End;
PVValue=AvgPrice[Value1]*Vmult*TempV[Value1];
cumpv[Value2]=
cumpv[Value2]+PVValue;
cumv[Value2] = cumv[Value2]
+TempV[Value1];
MIDAS[Value2]=
cumpv[Value2]/cumv[Value2];
End; End;
End; End Else begin If (TypAnal=1 and
Direct>0) or (TypAnal=2 and Direct<0) then begin
If TypAnal=2 then Value3=KntHigh else
Value3=KntLow;
Value2=Mod(Value3,4)+1;
MidasSet[Value2]=1; cumpv[Value2]= 0
{HLPrice}; cumv[Value2] =
0;
MIDAS[Value2]=HLPrice; For Value1=BackBars
DownTo 0 begin If Value1>0 then
begin If Value2=1 then
Plot1[Value1](MIDAS[1],"MDS1");
If Value2=2 then
Plot2[Value1](MIDAS[2],"MDS2");
If Value2=3 then
Plot3[Value1](MIDAS[3],"MDS3");
If Value2=4 then
Plot4[Value1](MIDAS[4],"MDS4");
End;
PVValue=AvgPrice[Value1]*Vmult*TempV[Value1];
cumpv[Value2]= cumpv[Value2] +
PVValue; cumv[Value2] =
cumv[Value2] +
TempV[Value1]; MIDAS[Value2]=
cumpv[Value2]/cumv[Value2]; TempM
= MIDAS[Value2]; End;
End; End;End;
If MidasSet[1]<>0 then
Plot1(MIDAS[1],"MDS1");If MidasSet[2]<>0 then
Plot2(MIDAS[2],"MDS2");If MidasSet[3]<>0 then
Plot3(MIDAS[3],"MDS3");If MidasSet[4]<>0 then
Plot4(MIDAS[4],"MDS4");
- - - - - - - - - - - - - - - - - - - -
- - - - - - - -Clyde Lee
Chairman/CEO (Home of
SwingMachine)SYTECH
Corporation email: <A
href="mailto:clydelee@xxxxxxxxxxxx">clydelee@xxxxxxxxxxxx 7910
Westglen, Suite 105
Office: (713) 783-9540Houston, TX
77063
Fax: (713) 783-1092Details
at:
www.theswingmachine.com- - - -
- - - - - - - - - - - - - - - - - - - - - - -
-
Yahoo! Groups Sponsor
To unsubscribe from this group, send an email to:
realtraders-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Attachment:
Description: "AutMidas.ela"
Attachment:
Description: "junk1.gif"
|