Aurix Exchange
Resource icon

Doji Hunter

No permission to download
For starters I added a RangeOfBars variable that allows you to indicate how many bars back from current bar you want to look for the doji. This allows for detection of double dojis as well. By setting the RangeOfBars to 2 or 3, you can look in the first, second or third candle position to find a potential double doji. In fact, you can create a method for IsDoji by looking at just the first candle position then create a second method that looks at first and second position for a double doji. In doing so, you can now write your code to say if IsDoji, no trade, if IsDoubleDoji trade on extension, etc, etc

The original coding for Doji Reader 2, handled 5 digit condition poorly, sorry partner, but here you will see there is a more efficient way to write it. Granted, mine may not be the best either, just one step closer.

I kept the ShowCandleBox, thought that was a nice way to place an indicator on the chart and it did well in testing. The extra indicators we nice, but I wanted to keep it simple. The extra text was also nice and somewhat educational to the user on the finding of the doji, but again, keeping it simple.

One change that was major was changing the configuration values to doubles instead of integers. By changing it to doubles, we can utilize the 5 digit precision and get a cleaner tighter doji, as you will see when you use it. Note: when you are using an indicator that is based on a double, never use an integer unless you are using it to count something.

I also added a counter reset so that the boxes didn't go on forever and ever in the counting process. Each time the indicator processes, it was still cycling the same counter, higher and higher. By including the reset, we still get an accurate count, but it resets when counting at the beginning of each process cycle.

I included a buffer and a buffer cleaning process so you can pass 0, by default and 1 if found to the code using the buffer. By keeping the range small we do not use excess CPU processing the old data we are not interested in.

Here is a sample declaration for putting it into your code:
First release
Last update
2.00 star(s) 1 ratings