Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 08:49:52 +0000



Post From: ACSIL code generated by Chat GPT

[2023-04-11 16:52:09]
Tony - Posts: 518
A user named Matias Quadro mentioned in this post that he managed to generated a study by Chat GPT, thought give it a try with Google Chat GPT, which only works in Chrome right now.

I typed "Sierra Chart ACSIL display last close price cross whole chart" and got this:


#include "sierrachart.h"

SCDLLName("Last Price Example")

SCSFExport scsf_LastPrice(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
sc.GraphName = "Last Price";
sc.StudyDescription = "Displays the last traded price";
sc.GraphRegion = 0;
sc.AutoLoop = 0;
sc.FreeDLL = 1;

sc.Subgraph[0].Name = "Last Price";
sc.Subgraph[0].DrawStyle = DRAWSTYLE_LINE;
sc.Subgraph[0].PrimaryColor = RGB(0, 255, 0);
return;
}

sc.Subgraph[0][sc.Index] = sc.BaseData[SC_LAST][sc.Index];
}

That is very interesting, didn't work though, until I made some modifications:


  for (int IndexCount {sc.Index}; IndexCount>sc.IndexOfFirstVisibleBar; IndexCount--)
    sc.Subgraph[0][IndexCount] = sc.BaseData[SC_LAST][sc.Index];

Maybe I asked the wrong question, I will try Bing's Chat GPT later, since I don't have access to Edge browser at this point...
Date Time Of Last Edit: 2023-04-11 16:53:47