Login Page - Create Account

Support Board


Date/Time: Wed, 05 Mar 2025 04:21:50 +0000



Post From: create a custom C++ class that manages trade/logic

[2022-01-08 15:41:38]
norvik_ - Posts: 106
struct some_struct
{
  some_struct() = defalt;
  some_struct(SCStudyInterfaceRef sc)

  void some_func(const SCDateTimeMS& when);

  private:

  std::unordered_map<SCDateTimeMS, s_SCTradeOrder> something;
}

const std::int32_t some_struct_pkey = 1;


SCSFExport scsf_some_study(SCStudyInterfaceRef sc)
{
  some_struct* ss = reinterpret_cast<some_struct*>(sc.GetPersistentPointer(some_struct_pkey));
  if (ss == nullptr)
    sc.SetPersistentPointer(some_struct_pkey, new some_struct(sc));


  if (sc.SetDefaults)
  {
  // Do something...
  }

  // Do something...

if(sc.LastCallToFunction)
delete ss;

}

It is documented on this site.