below is the TS code for the td sequential strategy. it shows up in signals but i cannot get it to show up on a chart in multicharts. it compiles but has a red check instead of a yellow one in the power editor. what does a red check mean? i do not know how to change this to an indicator. if someone does know how and could do it that would be appreciated. this is public code as you can see below. thanks, wayne at traderwep@gmail.com
Code: Select all
{ Tom DeMark TD Setup Long/Short Entry Strategy
Written by: HamFon
Contact: ncrowle@sprintmail.com
Date: 07/27/2002, original 07/27/2002
Revision: 1.00
Status: Gnu Public License - this indicator may be used or shared freely with
no fee, as long as this original header comment is included.
Purpose: Generates a Buy or Sell Short order based on conditions price trend
Source: Active Trader Magazine, July 2002, page 64.
}
{ Generates a Buy signal when:
1) For each of the last 9 bars, the close is less than the close of the bar 4 bars earlier.
Reverse everything for Sell Short signal.
}
inputs:
TimeStart (0), TimeEnd (0), { hhmm integer or 0 to ignore }
AllowMultipleEntries (false), { blocks new trades if one already active }
DoLong (true), DoShort (true)
;
variables: CountLong (0), CountShort (0);
if CurrentBar < 9 then begin
CountLong = 0;
CountShort = 0;
end else begin
if C >= C[4] then CountLong = 0
else CountLong = CountLong + 1;
if C <= C[4] then CountShort = 0
else CountShort = CountShort + 1;
end;
if (AllowMultipleEntries or MarketPosition = 0)
and (TimeStart = 0 or Time >= TimeStart) and (TimeEnd = 0 or time <= TimeEnd)
then begin
if DoLong and CountLong >= 9
and (L < L[2] and L < L[3]) or (L[1] < L[2] and L[1] < L[3])
then begin
Buy ("TMSetupLE") next bar at C or higher;
Alert ("Ham TMSetup LE");
CountLong = 0;
end;
if DoShort and CountShort >= 9
and (H > H[2] and H > H[3]) or (H[1] > H[2] and H[1] > H[3])
then begin
Sell Short ("TMSetupSE") next bar at C or lower;
Alert ("Ham TMSetup SE");
CountShort = 0;
end;
end;