#### Topic: Doji pattern in FSB

Dear forum,

I think it could be very interested if it was possible to include a doji candle pattern in a strategy in the FSB.
I have worked out this formula:

( ( high() - low() ) * 0.64 ) >= (( close () - open() )*(close()-open())) and high() - low() > 1

This think this will be able to scan for dojis with a body no larger then 8 % of the high of the candle minus the low of the candle.

Does anyone know how this can be created as an indicator that can be used in FSB?

Best regards
Itai

#### Re: Doji pattern in FSB The formula was changed a little. You can correct it if you want.

``````double point = (Digits == 5 || Digits == 3) ? 10 * Point : Point;
double maxOpenClose = 5 * point;
double minHeight    = 1.2 * maxOpenClose;

for (int iBar = 1; iBar < Bars; iBar++)
if (Math.Abs(Close[iBar - 1] - Open[iBar - 1]) < maxOpenClose && High[iBar - 1] - Low[iBar - 1] > minHeight)
doji[iBar] = 1;``````

#### Re: Doji pattern in FSB

Dear Popov|
open()-close()|<=(( high() - low() )*p ) for Small body

|open()-close()|>=(( high() - low() )*p ) for big body

p=Percent .9 to 0.5 for small
p= Percent .5 to 0.1 for big

We need an Indicators calculates this equation with the possibility for give us Insert  variable  of Percent to make Optimizing

#### Re: Doji pattern in FSB

The problem has been resolved
thanks  Popov.

#### Re: Doji pattern in FSB

Popov, thanks for the fast response and the attached indicator.

Just to understand it correctly.

``````double maxOpenClose = 5 * point;
double minHeight    = 1.2 * maxOpenClose;``````

Does the first line of this code indicate the size of the body of the doji? That the body can be max 5 points?
Can I adjust somewhere that the body of the doji maximum should be 8 percent of the total candle (highest - lowest)?
And a final question, is there in this indicator any limitation to the size of the total candle (Highest - lowest)?

#### Re: Doji pattern in FSB

``double point = (Digits == 5 || Digits == 3) ? 10 * Point : Point;``

This line compensate 5 digit quotations. Using it you can set n * point where "n" will work with 5 digits as well as 4 digit quotation.

``double maxOpenClose = 5 * point;``

together with

``Math.Abs(Close[iBar - 1] - Open[iBar - 1]) < maxOpenClose``

limits the max body height to 5 pips.

If you want percent rate, you can use:

``````if (Math.Abs(Close[iBar - 1] - Open[iBar - 1]) < PERCENT * (High[iBar - 1] - Low[iBar - 1]))
...``````

You can use an entry numerical box to setup PERCENT value from the Indicator Properties dialog window.

#### Re: Doji pattern in FSB

Thanks for the guidance.

I have now entered the percentage setup into the attached indicator.

I think it is correct, but it seem to work in back tests. Now it is interesting if it also works in forward testing.

If you have a moment please take a look at the coding. When I have results from the forward testing I will let you know of the performance.

#### Re: Doji pattern in FSB

I couldn't get these to work. They just put exclamation points above candles. Thoughts?

Thanks.

#### Re: Doji pattern in FSB

Exclamation points -- sounds like ambiguous signal. The indicator is telling it both long and short at the same time, in the side panel, "Allow Long/Short Entry" will both say "yes". Try adding another indicator to break the tie.

#### Re: Doji pattern in FSB

Popov wrote: The formula was changed a little. You can correct it if you want.

``````double point = (Digits == 5 || Digits == 3) ? 10 * Point : Point;
double maxOpenClose = 5 * point;
double minHeight    = 1.2 * maxOpenClose;

for (int iBar = 1; iBar < Bars; iBar++)
if (Math.Abs(Close[iBar - 1] - Open[iBar - 1]) < maxOpenClose && High[iBar - 1] - Low[iBar - 1] > minHeight)
doji[iBar] = 1;``````

HELLO