Support Board
Date/Time: Wed, 15 Jan 2025 18:02:48 +0000
Post From: Runtime Error received while backtesting
[2017-07-01 10:30:26] |
User972044 - Posts: 154 |
Try one of the Sierra Chart trading systems and see if you have the same problem. You definitely should not.
Refer to: Automated Trading From an Advanced Custom Study: Example Trading Systems and Code I backtested one of your sample .cpp file tradingsystem.cpp, specifically the first SCSFExport scsf_TradingExample(SCStudyInterfaceRef sc) where it contained a persistent variable int& r_BuyEntryInternalOrderID = sc.GetPersistentInt(1); I backtested the code, not one order got generated, I put in SCString Message1; Message1.Format("r_BuyEntryInternalOrderID: %d",r_BuyEntryInternalOrderID); sc.AddMessageToLog(Message1, 0); in two different places, one at where the variable was initialized and another when an order was generated and the Message1 did NOT even get outputted into the Message Log and there were orders generated by this sample trading system. So I have no idea what was the value of this persistent variable r_BuyEntryInternalOrderID, whether it was at 0 when it was initialized or not or whether it was changed and what it was changed to. As for my own codes, I tried resetting the persistent variables to 0 using sc.PersistVars->Integers[0] = 0; sc.PersistVars->Integers[1] = 0; like you suggested in the other ticket Persist Variables I tried using the new GetPersistent* functions, NOTHING worked. The two persistent variables stayed as 1086121984 always. I even tried to put them into a brand new custom study file as you mentioned that it could be memory corruption with this particular custom study file, still EXACTLY the same result: 1086121984. I tried with sc.Autoloop = 1 and sc.Autoloop = 0, still the same results: 1086121984. So I would appreciate it if you can investigate further to find out what could be the cause of this besides stating that it's my custom study files that's the problem. I created a brand new custom study file and setting persistent variables and it's still the same problem so it's NOT my custom study file anymore. The only outstanding problem is the persistent variables issue now. Date Time Of Last Edit: 2017-07-03 23:43:38
|