Login Page - Create Account

Support Board


Date/Time: Sun, 08 Sep 2024 00:15:45 +0000



Bill Williams Fractal study errors

View Count: 1800

[2014-12-16 01:28:08]
User56304 - Posts: 33
The Bill Williams Fractal study appears to be missing quite a few data points. I've highlighted just a few of the many on this 4 tick Renko chart. There are no other studies at all on this chart.
Attachment Deleted.
image2014-12-15_20-26-54.png / V - Attached On 2014-12-16 01:27:35 UTC - Size: 108.53 KB - 410 views
[2014-12-22 23:16:25]
Sierra Chart Engineering - Posts: 104368
We have looked into this, and the Bill Williams Fractals only uses the High and Low values of the chart bars and those are correctly displayed with the Candlestick Graph Draw Type you are using with Renko Bars.

Therefore, in the case of Renko bars there should not be any unusual problem compared with other Bar Period Types.


Although we can see a reason for a problem for another reason and we will be fixing this.


Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2014-12-22 23:17:47
[2014-12-24 02:02:46]
User56304 - Posts: 33
Here is the bulk of your code repair. However it does not address all the nuances of multiple tops/bottoms as can be seen here:

https://www.linnsoft.com/techind/fractals-swing-highs-swing-lows


Code snippet:


/***********************************************************************/
bool IsFractalBuySignal(SCFloatArrayRef InDataLow, SCFloatArrayRef InDataHigh, int index, int ArraySize)
{
  if (  
    ( ((index+2) <= (ArraySize-1)) &&
    InDataHigh[index] > InDataHigh[index + 1] && InDataHigh[index] > InDataHigh[index + 2] &&
    InDataHigh[index] > InDataHigh[index - 1] && InDataHigh[index] > InDataHigh[index - 2]
  )
    ||
    ( ((index+3) <= (ArraySize-1)) &&
    InDataHigh[index] > InDataHigh[index + 2] && InDataHigh[index] > InDataHigh[index + 3] &&
    InDataHigh[index] > InDataHigh[index - 1] && InDataHigh[index] > InDataHigh[index - 2] &&
    InDataHigh[index] == InDataHigh[index + 1]
  )
    ||
    ( ((index+4) <= (ArraySize-1)) &&
    InDataHigh[index] > InDataHigh[index + 3] && InDataHigh[index] > InDataHigh[index + 4] &&
    InDataHigh[index] > InDataHigh[index - 1] && InDataHigh[index] > InDataHigh[index - 2] &&
    InDataHigh[index] == InDataHigh[index + 1] && InDataHigh[index + 1] == InDataHigh[index + 2]
  )
    )
    return true;

  return false;
}

/***********************************************************************/
bool IsFractalSellSignal(SCFloatArrayRef InDataLow, int index, int ArraySize)
{
  if (
    ( ((index+2) <= (ArraySize-1)) &&
    InDataLow[index] < InDataLow[index + 1] && InDataLow[index] < InDataLow[index + 2] &&
    InDataLow[index] < InDataLow[index - 1] && InDataLow[index] < InDataLow[index - 2]
  )
    ||
    ( ((index+3) <= (ArraySize-1)) &&
    InDataLow[index] < InDataLow[index + 2] && InDataLow[index] < InDataLow[index + 3] &&
    InDataLow[index] < InDataLow[index - 1] && InDataLow[index] < InDataLow[index - 2] &&
    InDataLow[index] == InDataLow[index + 1]
  )
    ||
    ( ((index+4) <= (ArraySize-1)) &&
    InDataLow[index] < InDataLow[index + 3] && InDataLow[index] < InDataLow[index + 4] &&
    InDataLow[index] < InDataLow[index - 1] && InDataLow[index] < InDataLow[index - 2] &&
    InDataLow[index] == InDataLow[index + 1] && InDataLow[index + 1] == InDataLow[index + 2]
  )
    )
    return true;

  return false;
}

[2014-12-24 03:14:33]
Sierra Chart Engineering - Posts: 104368
This is still the old code.

And for additional enhancements according to what else you see that you require in the thread linked to, you are welcome to make any changes and create a new version of the study. This is easy to do.

Refer to the documentation here:
https://www.sierrachart.com/index.php?page=doc/doc_BuildCustomStudiesDLL.html
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2014-12-24 03:26:53]
User56304 - Posts: 33
It is in fact not identical to the code from Studies6.cpp

However I am not a professional programmer and must leave it to you to correct as you see fit, and also to model Bill Williams original work accurately. I'm not asking for enhancements, although if you're in the middle of it and would be willing to build in variations to the number of bars used to calculate the fractal (currently fixed at 5), it would be quite welcome.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account