Quote from Vienna:
Why doesn't anybody post a chart that shows that this actually works?
The attached chart doesnt, perhaps the poster mixed up red and green??
Quote from copa8:
hi,
does the method only works for daytrading or does it also work for other time-frames, e.g. swingtrading?
thanks in advance.
function ADX4Step (Bar: Integer): boolean;
begin
Result := ((ADX(Bar,14) - ADX(Bar-1,14)) > 4) or
((ADX(Bar,14) - ADX(Bar-2,14)) > 4) or
((ADX(Bar,14) - ADX(Bar-3,14)) > 4) or
((ADX(Bar,14) - ADX(Bar-4,14)) > 4) or
((ADX(Bar,14) - ADX(Bar-5,14)) > 4)
end;
var Bar: integer;
var DX_Val, ADX_Val, PDI_Val, MDI_Val: float;
var DX_Val_Last, ADX_Val_Last, PDI_Val_Last, MDI_Val_Last: float;
var tmp: string;
tmp = '';
for Bar := 14 to BarCount - 1 do
begin
PortfolioSynch(Bar, '');
DX_Val_Last := DX(Bar-1,14);
DX_Val := DX(Bar,14);
ADX_Val_Last := ADX(Bar-1,14);
ADX_Val := ADX(Bar,14);
PDI_Val_Last := DIPlus(Bar-1,14);
PDI_Val := DIPlus(Bar,14);
MDI_Val_Last := DIMinus(Bar-1,14);
MDI_Val := DIMinus(Bar,14);
if not LastPositionActive then
begin
If (PDI_Val > MDI_Val) and
(((ADX_Val > ADX_Val_Last) and (ADX_Val > MDI_Val)) OR
((ADX_Val > ADX_Val_Last) and (ADX_Val < PDI_Val) and (ADX_Val < MDI_Val) and
(ADX4Step(Bar) = True))) then
begin
BuyAtMarket(Bar+1, tmp);
end
else
If (MDI_Val > PDI_Val) and
(((ADX_Val > ADX_Val_Last) and (ADX_Val > PDI_Val)) OR
((ADX_Val > ADX_Val_Last) and (ADX_Val < PDI_Val) and (ADX_Val < MDI_Val))) then
begin
ShortAtMarket(Bar+1, tmp);
end;
end
else
begin
if PositionLong(LastPosition) then
begin
If ((ADX_Val < ADX_Val_Last) and (ADX_Val > PDI_Val) and (ADX_Val > MDI_Val)) OR
(MDI_Val > PDI_Val) then
begin
SellAtMarket(Bar+1, Lastposition, tmp);
end;
end
else
if PositionShort(LastPosition) then
begin
If ((ADX_Val < ADX_Val_Last) and (ADX_Val > PDI_Val) and (ADX_Val > MDI_Val)) OR
(PDI_Val > MDI_Val) then
begin
CoverAtMarket(Bar+1, LastPosition, tmp);
end;
end;
end;
end;
Quote from hayman:
OK, I have programmed this again into WealthLab, using Dr. Elder's rules, which were effectively posted by Electric Savant in the last post (I do not use multiple confirming periods, however). I cannot get a higher winning % that 38 % on any NYSE stock or ETF (SPY, e.g.). I'm not sure this is a viable system. I used Daily Bars by the way. Can anyone see a flaw in my logic ????
Code:function ADX4Step (Bar: Integer): boolean; begin Result := ((ADX(Bar,14) - ADX(Bar-1,14)) > 4) or ((ADX(Bar,14) - ADX(Bar-2,14)) > 4) or ((ADX(Bar,14) - ADX(Bar-3,14)) > 4) or ((ADX(Bar,14) - ADX(Bar-4,14)) > 4) or ((ADX(Bar,14) - ADX(Bar-5,14)) > 4) end; var Bar: integer; var DX_Val, ADX_Val, PDI_Val, MDI_Val: float; var DX_Val_Last, ADX_Val_Last, PDI_Val_Last, MDI_Val_Last: float; var tmp: string; tmp = ''; for Bar := 14 to BarCount - 1 do begin PortfolioSynch(Bar, ''); DX_Val_Last := DX(Bar-1,14); DX_Val := DX(Bar,14); ADX_Val_Last := ADX(Bar-1,14); ADX_Val := ADX(Bar,14); PDI_Val_Last := DIPlus(Bar-1,14); PDI_Val := DIPlus(Bar,14); MDI_Val_Last := DIMinus(Bar-1,14); MDI_Val := DIMinus(Bar,14); if not LastPositionActive then begin If (PDI_Val > MDI_Val) and (((ADX_Val > ADX_Val_Last) and (ADX_Val > MDI_Val)) OR ((ADX_Val > ADX_Val_Last) and (ADX_Val < PDI_Val) and (ADX_Val < MDI_Val) and (ADX4Step(Bar) = True))) then begin BuyAtMarket(Bar+1, tmp); end else If (MDI_Val > PDI_Val) and (((ADX_Val > ADX_Val_Last) and (ADX_Val > PDI_Val)) OR ((ADX_Val > ADX_Val_Last) and (ADX_Val < PDI_Val) and (ADX_Val < MDI_Val))) then begin ShortAtMarket(Bar+1, tmp); end; end else begin if PositionLong(LastPosition) then begin If ((ADX_Val < ADX_Val_Last) and (ADX_Val > PDI_Val) and (ADX_Val > MDI_Val)) OR (MDI_Val > PDI_Val) then begin SellAtMarket(Bar+1, Lastposition, tmp); end; end else if PositionShort(LastPosition) then begin If ((ADX_Val < ADX_Val_Last) and (ADX_Val > PDI_Val) and (ADX_Val > MDI_Val)) OR (PDI_Val > MDI_Val) then begin CoverAtMarket(Bar+1, LastPosition, tmp); end; end; end; end;
Quote from hayman:
OK, I have programmed this again into WealthLab, using Dr. Elder's rules, which were effectively posted by Electric Savant in the last post (I do not use multiple confirming periods, however). I cannot get a higher winning % that 38 % on any NYSE stock or ETF (SPY, e.g.). I'm not sure this is a viable system. I used Daily Bars by the way. Can anyone see a flaw in my logic ????
Quote from ElectricSavant:
The universe of stocks need to be low volatile stocks....try going long only on uptrending stocks.
Michael B.
Quote from nononsense:
Hi hayman,
You got ElectricSavant's point? Good old Elder apparently didn't tell us everything. You still seem to have to learn how to find "low volatile stocks" and to be able to recognize "uptrending".
Unfortunetely, good ElectricSavant didn't show us a program to spot uptrending in low volatile stocks.![]()
hayman, keep on working. You alone can find the answers. I also have stumbled on many crazy useless things in the past. ET is often not of much help in clearing up the fog. You seem to ask the right questions though.
Be good,
nononsense
Quote from ElectricSavant:
Well....
Use http://www.tickerrank.com
Rank your universe for "ADX/PDI/DMI sensitive stocks" by ranking with certain criteria....
Michael B.