Chop zone filter indicator

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Chop zone filter indicator

Postby Capie1 » Tue Aug 10, 2010 7:18 am

Hi

Help would be appreciated in coding this chop zone indicator for MarketScope:
We only have a Tradestation version of the indicator and would like to use it in Marketscope.
Herewith the indicator parameters:

1. Identify a marker bar (high/low)(adjustable time period)
2. When 4(adjustable) opens and closes are inside the marker bar high/low range. Chop Filter is confirmed
3. Once there is a close outside this high/low range the process starts all over again
4. Option to reset the indicator at start of each week( reset y/n).
5. Yellow painting of bars once chop zone confirms (after close of 4th Bar or as chosen).
6. Also able to see previous confirmed chop zones.

I will try to post the Tradestation code as soon as possible.

Thanks you in advance

Best Regards
Attachments
Consolidation indicator.jpg
Consolidation Indicator
Capie1
 
Posts: 10
Joined: Mon Jun 21, 2010 4:41 pm

Re: Chop zone filter indicator

Postby Apprentice » Tue Aug 10, 2010 8:02 am

Added to Development cue.
Code would certainly help.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Chop zone filter indicator

Postby Capie1 » Wed Aug 11, 2010 11:07 am

Herewith the Tradestation code (2 indicators/parts):
//Chop Filter Trendlines

inputs:
LineThickness(1),
LineColour(Yellow),
LongColour(Green),
ShortColour(Red),
ResetEndWeek(False),
// LineStyle(1),
ShowReversalLines(False),
ATRperiod(100);
// FilterColour(Blue);
Variables:
ChopFilterHi(0),
ChopFilterLo(0),
TLChopFilterHi(0),
TLChopFilterLo(0),
TLLongRev(0),
TLShortRev(0),
LongRev(0),
ShortRev(0),
ChopFilter(False);


//Re-set the filter at the start of a new week
If ResetEndWeek then begin
if DayOfWeek(Date) < DayOfWeek(Date[1]) then ChopFilter = False;
end;


//Identify four inside bodies
if ChopFilter = False then begin


If ResetEndWeek = true then begin
if Open <= High[4] and
Open[1] <= High[4] and
Open[2] <= High[4] and
Open[3] <= High[4] and
Close <= High[4] and
Close[1]<= High[4] and
Close[2]<= High[4] and
Close[3]<= High[4] and
Open >= Low[4] and
Open[1] >= Low[4] and
Open[2] >= Low[4] and
Open[3] >= Low[4] and
Close >= Low[4] and
Close[1]>= Low[4] and
Close[2]>= Low[4] and
Close[3]>= Low[4]
and DayOfWeek(Date) >= DayOfWeek(Date[4])//so the filter is entirely within the current week
then begin
ChopFilter = True;
ChopFilterHi = High[4];
ChopFilterLo = Low[4];
end;
end;
If ResetEndWeek = false then begin
if Open <= High[4] and
Open[1] <= High[4] and
Open[2] <= High[4] and
Open[3] <= High[4] and
Close <= High[4] and
Close[1]<= High[4] and
Close[2]<= High[4] and
Close[3]<= High[4] and
Open >= Low[4] and
Open[1] >= Low[4] and
Open[2] >= Low[4] and
Open[3] >= Low[4] and
Close >= Low[4] and
Close[1]>= Low[4] and
Close[2]>= Low[4] and
Close[3]>= Low[4]
then begin
ChopFilter = True;
ChopFilterHi = High[4];
ChopFilterLo = Low[4];
end;
end;


end;


//Re-set the filter at the start of a new week
//if DayOfWeek(Date[1]) > DayOfWeek(Date) then ChopFilter = False;




//Identify a confirmed break of the range


If ChopFilter = True then begin
If Close > ChopFilterHi
or Close < ChopFilterLo
then ChopFilter = False;
end;


//Calculate the reversal levels


LongRev = ChopFilterLo + (AvgTrueRange(ATRperiod)data2 * 0.2);
ShortRev = ChopFilterHi - (AvgTrueRange(ATRperiod)data2 * 0.2);




//Draw the lines


if ChopFilter then
begin
if ChopFilter = true then begin
TLChopFilterHi = TL_New( Date[4], Time[4] , ChopFilterHi, Date, Time, ChopFilterHi ) ;
TL_SetExtLeft( TLChopFilterHi,false ) ;
TL_SetExtRight( TLChopFilterHi, false ) ;
TL_SetColor( TLChopFilterHi, LineColour ) ;
TL_SetSize( TLChopFilterHi, LineThickness ) ;
// TL_SetStyle( TLChopFilterHi, LineStyle ) ;
end;


if ChopFilter = true then begin
TLChopFilterLo = TL_New( Date[4], Time[4] , ChopFilterLo, Date, Time, ChopFilterLo ) ;
TL_SetExtLeft( TLChopFilterLo,false ) ;
TL_SetExtRight( TLChopFilterLo, false ) ;
TL_SetColor( TLChopFilterLo, LineColour ) ;
TL_SetSize( TLChopFilterLo, LineThickness ) ;
// TL_SetStyle( TLChopFilterLo, LineStyle ) ;
end;


if ShowReversalLines then begin
if ChopFilter = true then begin
TLLongRev = TL_New( Date[4], Time[4] , LongRev, Date, Time, LongRev ) ;
TL_SetExtLeft( TLLongRev,false ) ;
TL_SetExtRight( TLLongRev, false ) ;
TL_SetColor( TLLongRev, LongColour ) ;
TL_SetSize( TLLongRev, LineThickness ) ;
// TL_SetStyle( TLChopFilterHi, LineStyle ) ;
end;


if ChopFilter = true then begin
TLShortRev = TL_New( Date[4], Time[4] , ShortRev, Date, Time, ShortRev ) ;
TL_SetExtLeft( TLShortRev,false ) ;
TL_SetExtRight( TLShortRev, false ) ;
TL_SetColor( TLShortRev, ShortColour ) ;
TL_SetSize( TLShortRev, LineThickness ) ;
// TL_SetStyle( TLChopFilterLo, LineStyle ) ;
end;
end;












end;


Part 2

//Chop Filter (Paintbar)


inputs: ResetEndWeek(False),
FilterColour(Yellow);
Variables:
ChopFilterHi(0),
ChopFilterLo(0),
ChopFilter(False);


//Identify four inside bodies
if ChopFilter = False then begin
If ResetEndWeek = true then begin
if Open <= High[4] and
Open[1] <= High[4] and
Open[2] <= High[4] and
Open[3] <= High[4] and
Close <= High[4] and
Close[1]<= High[4] and
Close[2]<= High[4] and
Close[3]<= High[4] and
Open >= Low[4] and
Open[1] >= Low[4] and
Open[2] >= Low[4] and
Open[3] >= Low[4] and
Close >= Low[4] and
Close[1]>= Low[4] and
Close[2]>= Low[4] and
Close[3]>= Low[4]
and DayOfWeek(Date) >= DayOfWeek(Date[4])//so the filter is entirely within the current week
then begin
ChopFilter = True;
ChopFilterHi = High[4];
ChopFilterLo = Low[4];
end;
end;
If ResetEndWeek = false then begin
if Open <= High[4] and
Open[1] <= High[4] and
Open[2] <= High[4] and
Open[3] <= High[4] and
Close <= High[4] and
Close[1]<= High[4] and
Close[2]<= High[4] and
Close[3]<= High[4] and
Open >= Low[4] and
Open[1] >= Low[4] and
Open[2] >= Low[4] and
Open[3] >= Low[4] and
Close >= Low[4] and
Close[1]>= Low[4] and
Close[2]>= Low[4] and
Close[3]>= Low[4]
then begin
ChopFilter = True;
ChopFilterHi = High[4];
ChopFilterLo = Low[4];
end;
end;


end;


//Re-set the filter at the start of a new week
If ResetEndWeek then begin
if DayOfWeek(Date) < DayOfWeek(Date[1]) then ChopFilter = False;
end;






//Identify a confirmed break of the range


If ChopFilter = True then begin
If Close > ChopFilterHi
or Close < ChopFilterLo
then ChopFilter = False;
end;




if ChopFilter then
begin
PlotPaintBar( High, Low, Open, Close, "ChopFilter", FilterColour ) ;
Alert ;
end
else
NoPlot( 1 ) ; { unpaint the bar }
Capie1
 
Posts: 10
Joined: Mon Jun 21, 2010 4:41 pm

Re: Chop zone filter indicator

Postby Capie1 » Wed Sep 08, 2010 9:49 am

Hi

Really a simple indicator marking of a combination of 5 candles (or more) whenever at least 4 sucessive candle bodies (open and close)or more are contained within the High/Low range of the first candle.
Capie1
 
Posts: 10
Joined: Mon Jun 21, 2010 4:41 pm

Re: Chop zone filter indicator

Postby Capie1 » Tue Sep 28, 2010 5:59 am

Hi

Any idea when this request could progress up the development queue?

Regards
Capie1
 
Posts: 10
Joined: Mon Jun 21, 2010 4:41 pm


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 34 guests