Support Board
Date/Time: Wed, 05 Mar 2025 04:22:50 +0000
Post From: create a custom C++ class that manages trade/logic
[2022-01-11 03:23:32] |
User133994 - Posts: 80 |
I'll answer my own questions: Yes, I can do what I wrote above...with a couple notes: note 1: in order to use sc object...I must pass it in each time... thus some_struct(SCStudyInterfaceRef sc)
Anyone know how to make a private member point to SCStudyInterfaceRef sc? That would be ideal and sc wouldn't need to be an input to every single function that uses it. void example_using_sc_inside(SCStudyInterfaceRef sc){sc.SupportTradingScaleIn = true;}; note 2: Don't have this study loaded on a chart when you recompile it--Sierra Chart crashes immediately without warning (likely due to using new/delete, maybe something else) note 3: to make use the new struct object in the scsf_some_study study, here are some example uses: ss->record_ID(12356173); ss->localID = 3843028; // if you had a public member of data type int called localID int studyspaceID = ss->localID; // could also create a "get" function and keep localID private ss->example_using_sc_inside(sc); note 4: add a semicolon after the struct definition struct some_struct { . . . }; Also, REMOVE this line: std::unordered_map<SCDateTimeMS, s_SCTradeOrder> something;
it causes compiler issues--and I don't need a hash right now anyway.I am sure I missed some things or didn't do it optimally, however, I can vouch that the above works as advertised. Please do share any improvements, corrections, or other. So glad it is working...wow. Excellent foundation to begin on. Thanks all |