Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 17:29:58 +0000



[Programming Help] - Bill Williams Alligator indicator returning incorrect values from what is rendered

View Count: 277

[2023-11-17 02:37:33]
quriousqitty - Posts: 13
I have ACSIL code that pulls data from the alligator indicator as well as the Moving Average indicator. The MA values are correct but the alligator values are off.


  int TEETH_INDEX = 1;
  int MA_INDEX = 0;

  // load 3m trend MA
  SCFloatArray trendMA3m;
  sc.GetStudyArrayUsingID(MAStudy3m.GetStudyID(), MA_INDEX, trendMA3m);
  
  // load 3m WA teeth study
  SCFloatArray WATeeth3m;
  sc.GetStudyArrayUsingID(WAStudy3m.GetStudyID(), JAW_INDEX, WATeeth3m);


  Logger.Format("long hh:mm, teeth, ma, %d:%d, %f, %f",hour, minute, WATeeth3m[sc.Index], trendMA3m[sc.Index]);

The alligator values are off by a few points for all the subgraphs from what is rendered and I'm not sure why.
[2023-11-19 20:52:04]
quriousqitty - Posts: 13
In case others run into this issue in the future, the values returned at sc.Index in code were different from the values rendered because for some weird reason, the values at sc.Index are actually lagging. i.e. WATeeth3m[sc.Index] is actually WATeeth3m[sc.Index - 5]. I'm not sure why 5 or why this behavior but it is what it is. :(

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

Login

Login Page - Create Account