Skip to content

Instantly share code, notes, and snippets.

@danielnegri
Last active March 25, 2024 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielnegri/103faf170e8da0a5235f0a6dbbb072d7 to your computer and use it in GitHub Desktop.
Save danielnegri/103faf170e8da0a5235f0a6dbbb072d7 to your computer and use it in GitHub Desktop.
Candle Forca (Nelogica Profit)
var
reference : float;
touchedMME9 : Boolean;
touchedMMA20 : Boolean;
hasVolume : Boolean;
hasBody : Boolean;
isUpBar : Boolean;
mustPlotRange : Boolean;
begin
reference := MediaExp(20,TrueRange);
touchedMME9 := (low <= MediaExp(9,close)) and (MediaExp(9,close) <= high);
touchedMMA20 := (low <= Media(20,close)) and (Media(20,close) <= high);
hasVolume := (volume > Media(20,volume) * 1.23) and (volume[0] > volume[1]);
hasBody := (open - close) > (high - low) * 0.6;
isUpBar := open < close;
// Plot Range
mustPlotRange := hasVolume;
if mustPlotRange then
begin
if isUpBar then
PlotText(Round(range),clBlack,0,8)
else
PlotText(Round(range),clBlack,2,8);
end;
// PaintBar
if (range > reference) and hasVolume and hasBody and touchedMME9 and touchedMMA20 then
begin
PaintBar(clPurple);
end
else if (range > reference) and hasVolume and hasBody then
begin
PaintBar(clBlue);
end
else if hasVolume then
begin
PaintBar(clDkGray);
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment