Hello The Henk,
I’m part of the Client Training and Education department for TradeStation. According to your posts, it appears that what you are really after is an indicator designed for RadarScreen that can show you when Inside Bars and CCCs take place on a daily chart real-time on a daily basis. You also seem to be content with your chart indicator, therefore no chart indicator is included in this response. The code below is for an indicator that identifies Inside Bars, counts how many Inside Bars occurred consecutively, identifies CCCs, and counts how many occurred consecutively. I understand that you intend for the indicator to be applied to 20 or so FX pairs, however if you apply the indicator to a larger amount of securities (i.e. the components of the S&P 500 index), you may want to sort the results. To do so, simply right-click in the RadarScreen window, select “Format Page”, then select the “Sort” tab and select to sort first by IB Status and then by CCC Status. You can also specify to automatically keep the data sorted by a certain amount of seconds in the same window. Both fields have color coded backgrounds in RadarScreen for visual help.
// RadarScreen Indicator Code to identify Inside Bars and CCCs
// Inputs Declaration
Inputs: IBColor ( Red ),
CCCColor ( Blue );
// Variables Declaration
Vars: ibcondition ( false ),
ibstatus ( "" ),
ibcounter ( 0 ),
inside ( false ),
ccccondition ( false ),
cccstatus ( "" ),
ccccounter ( 0 ),
cccdisplay ( "" );
// Inside Bar (IB) Condition
ibcondition = high[1] > High and low[1] < low;
// Congestion, Convergence, Centering (CCC) Condition
inside = High <= high[1] and low >= low[1];
ccccondition = inside and inside[1];
// Check for IBs and CCCs
If ibcondition then
begin
ibstatus = "Inside Bar";
ibcounter = ibcounter + 1;
SetPlotBGColor(1, IBColor);
end
else
begin
ibstatus = "";
ibcounter = 0;
end;
If ccccondition then
begin
cccstatus = "CCC";
ccccounter = ccccounter + 1;
SetPlotBGColor(2, CCCColor);
end
else
begin
cccstatus = "";
ccccounter = 0;
end;
// Display Results in RadarScreen
if ccccounter >= 1 then
cccdisplay =( NumToStr(ccccounter, 0) + Spaces(2) + cccstatus )
Else
cccdisplay = "0 CCC";
If ibcounter >= 1 then begin
Plot1( NumToStr(ibcounter, 0) + Spaces(2) + ibstatus, "IB Status" );
Plot2( cccdisplay, "CCC Status" );
End
Else begin
NoPlot(1);
NoPlot(2);
end;