Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 01:59:35 +0000



[Programming Help] - Zigzag Reversals with ACSIL

View Count: 991

[2020-07-20 18:37:43]
User40794 - Posts: 2
I am trying to port my spreadsheet subgraph to acsil DLLs


In spreadsheet I use 5 recent zigzag Reversal prices and use them to plot various subgraphs (basically calculating fib levels etc)


How can I get reversal price as variable in c++? I know I am asking for code and this is not entertained here but I am lost how to go about it.

I can plot zigzag on the chart with following code:
sc.ZigZag2(sc.High, sc.Low, Subgraph_ZigZag1, 2, 4, 1);

Thanks and regards
Date Time Of Last Edit: 2020-07-20 20:01:06
[2020-07-20 22:08:13]
bradh - Posts: 854
How can I get reversal price as variable in c++?

If you want code, I suggest you study the code for the ZigZag study. There is an option there to enable Additional Output for Spreadsheets.

You can start by adding that study, enabling the additional outputs and look at what you get in a spreadsheet study. Then you should be able to get the variables you need for your study, either as subgraphs from the ZigZag study or by doing the same thing in your code.
[2020-07-24 15:19:20]
User40794 - Posts: 2
For anyone looking for something similar in future, here is what I did.


Create a subgraph reversal and run a for loop


  for (int i = 0; i < 200; i++)
  {
    if ((Subgraph_ZigZag[sc.Index - i] < Subgraph_ZigZag[sc.Index - i - 1] && Subgraph_ZigZag[sc.Index - i - 1] > Subgraph_ZigZag[sc.Index - i - 2]) ||
      (Subgraph_ZigZag[sc.Index - i] > Subgraph_ZigZag[sc.Index - i - 1] && Subgraph_ZigZag[sc.Index - i - 1] < Subgraph_ZigZag[sc.Index - i - 2]))
    {
      Subgraph_zzRev[sc.Index - i - 1] = Subgraph_ZigZag[sc.Index - i - 1];
    }
  }


This will index Subgraph_zzRev with reversal points.


then create Arrays that will hold reversals n-1, n-2, n-3 and so on.

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

Login

Login Page - Create Account