Support Board
Date/Time: Wed, 24 Apr 2024 09:16:58 +0000
[Programming Help] - changing an opened chart parameters
View Count: 614
[2018-11-05 04:48:59] |
__deuss - Posts: 3 |
Hi Sierra team is it possible to change an opened chart parameters for example if i have two chart that are opened like this for (int i = 1; i <= 2; i++) { ChartsMap = Chartss{}; ChartsMap.Resolution = 30000/i; s_ACSOpenChartParameters OpenChartParameters; //OpenChartParameters.PriorChartNumber = ChartNumber; OpenChartParameters.ChartDataType = INTRADAY_DATA; //This can also be set to: DAILY_DATA OpenChartParameters.Symbol = sc.GetRealTimeSymbol();// sc.Symbol('ESU8')//When want to use the symbol of the chart the study function is on, use sc.GetRealTimeSymbol() OpenChartParameters.IntradayBarPeriodType = IBPT_VOLUME_PER_BAR; OpenChartParameters.IntradayBarPeriodLength = ChartsMap[Rsltn].Resolution; OpenChartParameters.LoadWeekendData = 1; ChartsMap.ChartNumber = sc.OpenChartOrGetChartReference(OpenChartParameters); sc.SetChartWindowState(ChartsMap.ChartNumber, CWS_RESTORE); } how can i modify both chart number 2 and 3 down the road let say there is a condition based on which at each trading day start i have to reset the chart parameters base on the volume of the previous day. i just need a function to modify the opened chart volume. i already tried to close all the previous chart like this and open a new charts with new parameters but that is not working correctly if (Reset == true) { firstRun = true; startIndex = Index; } int CurrentBarTime = sc.BaseDateTimeIn[Index].GetTime(); if (firstRun && (CurrentBarTime >= 34200 && CurrentBarTime < 57600)){ float tmpVolume = (0.05f)*(Index - startIndex)*15000; int i = 2; while(i >= 1){ if (sc.IsChartNumberExist(ChartsMap.ChartNumber, "")) { sc.CloseChart(ChartsMap.ChartNumber); } ChartsMap.Resolution = (int)(tmpVolume / i); i--; } Message.Format("first Resolution: %d, first id: %d, Second Resolution: %d, Second id: %d, currentIndex: %d, startIndex: %d", ChartsMap[1].Resolution, ChartsMap[1].ChartNumber, ChartsMap[2].Resolution, ChartsMap[2].ChartNumber, Index, startIndex); sc.AddMessageToLog(Message, 0); firstRun = false; } can you please advise? |
[2018-11-05 04:54:01] |
__deuss - Posts: 3 |
Even with the last condition. if (sc.IsChartNumberExist(ChartsMap.ChartNumber, "")) { sc.CloseChart(ChartsMap.ChartNumber); } I'm still getting errors like this can you please check the behavior of this? see logs: Reading Internal Order ID file. | 2018-11-04 23:51:38 Reading Trade Orders file. | 2018-11-04 23:51:38 Reading Trade Positions file. | 2018-11-04 23:51:38 Account Balance file. | 2018-11-04 23:51:38 Listening on UDP port 22904. | 2018-11-04 23:51:38 Software version: 1834 32-bit | 2018-11-04 23:51:38 Usage end date: 2018-11-27 | 2018-11-04 23:51:38 Enabled for: Advanced Features. | 2018-11-04 23:51:38 Enabled for: Sierra Chart Historical Data Service. | 2018-11-04 23:51:38 Allow Support for Sierra Chart Data Feeds is enabled. | 2018-11-04 23:51:38 Current selected Data/Trading service: SC Data - All Services | 2018-11-04 23:51:38 Chart Update Interval: 500 | 2018-11-04 23:51:38 Time Zone: -05:00:00 (EST-05EDT+01,M3.2.0/02:00,M11.1.0/02:00) | 2018-11-04 23:51:38 2018-11-04 23:51:37 Local computer time | 2018-11-04 23:51:38 2018-11-05 04:51:37 Local computer time in UTC | 2018-11-04 23:51:38 2018-11-04 23:51:37 Local computer time in SC Time Zone | 2018-11-04 23:51:38 2018-11-05 04:51:37 Server time in UTC | 2018-11-04 23:51:38 Local computer UTC time and Server UTC time difference: 0 seconds. | 2018-11-04 23:51:38 Program path: C:\SierraChart\ | 2018-11-04 23:51:38 Data Files path: C:\SierraChart\Data\ | 2018-11-04 23:51:38 OS Version Number: 10.0 | 2018-11-04 23:51:38 Locale Setting: C | 2018-11-04 23:51:38 Checking for new symbol settings for service code scdataallservices | 2018-11-04 23:51:38 HTTPS www.sierrachart.com:443 (4) | Creating socket. Using TLS 1.2. | 2018-11-04 23:51:38 HTTPS www.sierrachart.com:443 (4) | Connecting to IP: 204.15.192.108. | 2018-11-04 23:51:38 Received 5 login tokens. | 2018-11-04 23:51:38 HTTPS www.sierrachart.com:443 (5) | Creating socket. Using TLS 1.2. | 2018-11-04 23:51:40 HTTPS www.sierrachart.com:443 (5) | Connecting to IP: 204.15.192.108. | 2018-11-04 23:51:40 Symbol settings are up-to-date for scdataallservices | 2018-11-04 23:51:41 HTTPS login.sierrachart.com:443 (1) | Socket gracefully closed by remote side. | 2018-11-04 23:51:42 HTTPS login.sierrachart.com:443 (1) | Received socket Close event. | 2018-11-04 23:51:42 HTTPS login.sierrachart.com:443 (1) | Signaling to core to close socket | 2018-11-04 23:51:42 HTTPS login.sierrachart.com:443 (1) | Graceful close received or receive error. Shutdown complete. Closing socket now. | 2018-11-04 23:51:42 HTTPS login.sierrachart.com:443 (1) | Closed. | 2018-11-04 23:51:42 SC Data - All Services | Connected to data server. | 2018-11-04 23:51:43 HTTPS www.sierrachart.com:443 (2) | Socket gracefully closed by remote side. | 2018-11-04 23:51:43 HTTPS www.sierrachart.com:443 (2) | Received socket Close event. | 2018-11-04 23:51:43 HTTPS www.sierrachart.com:443 (2) | Signaling to core to close socket | 2018-11-04 23:51:43 HTTPS www.sierrachart.com:443 (2) | Graceful close received or receive error. Shutdown complete. Closing socket now. | 2018-11-04 23:51:43 HTTPS www.sierrachart.com:443 (2) | Closed. | 2018-11-04 23:51:43 HTTPS www.sierrachart.com:443 (5) | Socket gracefully closed by remote side. | 2018-11-04 23:51:45 HTTPS www.sierrachart.com:443 (5) | Signaling to core to close socket | 2018-11-04 23:51:45 HTTPS www.sierrachart.com:443 (5) | Received socket Close event. | 2018-11-04 23:51:45 HTTPS www.sierrachart.com:443 (5) | Graceful close received or receive error. Shutdown complete. Closing socket now. | 2018-11-04 23:51:45 HTTPS www.sierrachart.com:443 (5) | Closed. | 2018-11-04 23:51:45 HTTPS www.sierrachart.com:443 (4) | Socket gracefully closed by remote side. | 2018-11-04 23:51:46 HTTPS www.sierrachart.com:443 (4) | Received socket Close event. | 2018-11-04 23:51:46 HTTPS www.sierrachart.com:443 (4) | Signaling to core to close socket | 2018-11-04 23:51:46 HTTPS www.sierrachart.com:443 (4) | Graceful close received or receive error. Shutdown complete. Closing socket now. | 2018-11-04 23:51:46 HTTPS www.sierrachart.com:443 (4) | Closed. | 2018-11-04 23:51:46 ESZ18 15000 Volume #1 | Reloading chart. | 2018-11-04 23:51:54 SC Data - All Services | Starting real-time market data updates for: ESZ18. ID: 1 | 2018-11-04 23:51:55 SC Data - All Services | Subscribing to streaming market data in the service client is not supported. Symbol: ESZ18 | 2018-11-04 23:51:55 SC Data - All Services | Requesting security definition data for: ESZ18. ID: 1 | 2018-11-04 23:51:55 Intraday data recording state for symbol ESZ18 is set to download 'Pending'. | 2018-11-04 23:51:55 Delaying start of download for ESZ18 | 2018-11-04 23:51:55 ESZ18 15000 Volume #1 | Reloading chart. | 2018-11-04 23:51:59 HD Request # 2 | Downloading Intraday chart data for ESZ18 to the file ESZ18.scid. Service: cme | 2018-11-04 23:52:00 HD Request # 2 | Download start date-time: 2018-11-04 23:14:34.000 | 2018-11-04 23:52:00 HD Request # 2 | Using server: ds7.sierracharts.com port 10149 | 2018-11-04 23:52:00 Socket (1) | Creating socket. | 2018-11-04 23:52:00 Socket (1) | Connecting to IP: 8.18.161.133. | 2018-11-04 23:52:00 HD Request # 2 | Setting DTC encoding to Binary VLS | 2018-11-04 23:52:00 HD Request # 2 | Sending historical data logon request message. | 2018-11-04 23:52:00 HD Request # 2 | Requesting Intraday data. Start date-time: 2018-11-04 23:14:34. Record interval: 1. Symbol: ESZ18 | 2018-11-04 23:52:00 HD Request # 2 | Decompressing data. | 2018-11-04 23:52:00 HD Request # 2 | Receiving Intraday data for ESZ18 starting at 2018-11-04 23:14:34 | 2018-11-04 23:52:00 HD Request # 2 | Timestamp of first Intraday data file record written: 2018-11-04 23:14:34 | 2018-11-04 23:52:00 Socket (1) | Signaling to core to close socket | 2018-11-04 23:52:00 Historical data download thread signaled to stop. | 2018-11-04 23:52:00 Socket (1) | Shutdown started. Waiting for graceful close. | 2018-11-04 23:52:00 HD Request # 2 | Received 212 records from 2018-11-04 23:14:34 to 2018-11-04 23:41:53 (27.3 minutes) and wrote 212 records for ESZ18 | 2018-11-04 23:52:00 HD Request # 2 | Completion time: 0s | 2018-11-04 23:52:00 HD Request # 2 | Intraday data download complete for ESZ18. Unique request ID: 1 | 2018-11-04 23:52:00 Removed historical data download ID 1 | 2018-11-04 23:52:00 Real-time Intraday chart data file updates started for ESZ18 | 2018-11-04 23:52:00 Opened cached Intraday file: C:\SierraChart\Data\ESZ18.scid | 2018-11-04 23:52:00 Intraday chart data file opened for ESZ18 | 2018-11-04 23:52:00 Socket (1) | Socket gracefully closed by remote side. | 2018-11-04 23:52:00 Socket (1) | Closed. | 2018-11-04 23:52:00 ESZ18 11250 Volume #2 | Reloading chart. | 2018-11-04 23:52:01 ESZ18 5625 Volume #3 | Reloading chart. | 2018-11-04 23:52:01 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 11250, first id: 2, Second Resolution: 5625, Second id: 3, currentIndex: 16, startIndex: 1 | 2018-11-04 23:52:01 ESZ18 12750 Volume #4 | Reloading chart. | 2018-11-04 23:52:01 ESZ18 6375 Volume #5 | Reloading chart. | 2018-11-04 23:52:02 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 12750, first id: 4, Second Resolution: 6375, Second id: 5, currentIndex: 133, startIndex: 116 | 2018-11-04 23:52:02 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 11250, first id: 2, Second Resolution: 5625, Second id: 3, currentIndex: 247, startIndex: 232 | 2018-11-04 23:52:02 ESZ18 41250 Volume #6 | Reloading chart. | 2018-11-04 23:52:02 ESZ18 20625 Volume #7 | Reloading chart. | 2018-11-04 23:52:02 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 41250, first id: 6, Second Resolution: 20625, Second id: 7, currentIndex: 511, startIndex: 456 | 2018-11-04 23:52:02 ESZ18 23250 Volume #8 | Reloading chart. | 2018-11-04 23:52:02 ESZ18 11625 Volume #9 | Reloading chart. | 2018-11-04 23:52:02 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 23250, first id: 8, Second Resolution: 11625, Second id: 9, currentIndex: 749, startIndex: 718 | 2018-11-04 23:52:02 ESZ18 16500 Volume #10 | Reloading chart. | 2018-11-04 23:52:02 ESZ18 8250 Volume #11 | Reloading chart. | 2018-11-04 23:52:02 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 16500, first id: 10, Second Resolution: 8250, Second id: 11, currentIndex: 922, startIndex: 900 | 2018-11-04 23:52:02 ESZ18 14250 Volume #12 | Reloading chart. | 2018-11-04 23:52:02 ESZ18 7125 Volume #13 | Reloading chart. | 2018-11-04 23:52:02 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 14250, first id: 12, Second Resolution: 7125, Second id: 13, currentIndex: 1033, startIndex: 1014 | 2018-11-04 23:52:02 ESZ18 13500 Volume #14 | Reloading chart. | 2018-11-04 23:52:02 ESZ18 6750 Volume #15 | Reloading chart. | 2018-11-04 23:52:02 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 13500, first id: 14, Second Resolution: 6750, Second id: 15, currentIndex: 1147, startIndex: 1129 | 2018-11-04 23:52:02 ESZ18 10500 Volume #16 | Reloading chart. | 2018-11-04 23:52:03 ESZ18 5250 Volume #17 | Reloading chart. | 2018-11-04 23:52:03 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 10500, first id: 16, Second Resolution: 5250, Second id: 17, currentIndex: 1269, startIndex: 1255 | 2018-11-04 23:52:03 ESZ18 17250 Volume #18 | Reloading chart. | 2018-11-04 23:52:03 ESZ18 8625 Volume #19 | Reloading chart. | 2018-11-04 23:52:03 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 17250, first id: 18, Second Resolution: 8625, Second id: 19, currentIndex: 1422, startIndex: 1399 | 2018-11-04 23:52:03 ESZ18 7500 Volume #20 | Reloading chart. | 2018-11-04 23:52:03 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 15000, first id: 1, Second Resolution: 7500, Second id: 20, currentIndex: 1550, startIndex: 1530 | 2018-11-04 23:52:03 ESZ18 27000 Volume #21 | Reloading chart. | 2018-11-04 23:52:03 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 27000, first id: 21, Second Resolution: 13500, Second id: 14, currentIndex: 1674, startIndex: 1638 | 2018-11-04 23:52:03 ESZ18 19500 Volume #22 | Reloading chart. | 2018-11-04 23:52:03 ESZ18 9750 Volume #23 | Reloading chart. | 2018-11-04 23:52:03 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 19500, first id: 22, Second Resolution: 9750, Second id: 23, currentIndex: 1849, startIndex: 1823 | 2018-11-04 23:52:03 ESZ18 24000 Volume #24 | Reloading chart. | 2018-11-04 23:52:04 ESZ18 12000 Volume #25 | Reloading chart. | 2018-11-04 23:52:04 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 24000, first id: 24, Second Resolution: 12000, Second id: 25, currentIndex: 2040, startIndex: 2008 | 2018-11-04 23:52:04 ESZ18 29250 Volume #26 | Reloading chart. | 2018-11-04 23:52:04 ESZ18 14625 Volume #27 | Reloading chart. | 2018-11-04 23:52:04 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 29250, first id: 26, Second Resolution: 14625, Second id: 27, currentIndex: 2212, startIndex: 2173 | 2018-11-04 23:52:04 ESZ18 18000 Volume #28 | Reloading chart. | 2018-11-04 23:52:04 ESZ18 9000 Volume #29 | Reloading chart. | 2018-11-04 23:52:04 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 18000, first id: 28, Second Resolution: 9000, Second id: 29, currentIndex: 2424, startIndex: 2400 | 2018-11-04 23:52:04 ESZ18 18750 Volume #30 | Reloading chart. | 2018-11-04 23:52:04 ESZ18 9375 Volume #31 | Reloading chart. | 2018-11-04 23:52:05 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 18750, first id: 30, Second Resolution: 9375, Second id: 31, currentIndex: 2606, startIndex: 2581 | 2018-11-04 23:52:05 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 17250, first id: 18, Second Resolution: 8625, Second id: 19, currentIndex: 2766, startIndex: 2743 | 2018-11-04 23:52:05 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 13500, first id: 14, Second Resolution: 6750, Second id: 15, currentIndex: 2919, startIndex: 2901 | 2018-11-04 23:52:05 ESZ18 22500 Volume #32 | Reloading chart. | 2018-11-04 23:52:05 Chart: ESZ18 15000 Volume #1 | Study: Custom DLL Study | first Resolution: 22500, first id: 32, Second Resolution: 11250, Second id: 2, currentIndex: 3049, startIndex: 3019 | 2018-11-04 23:52:05 Closing chart #3 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #3. | 2018-11-04 23:52:05 Closing chart #2 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #2. | 2018-11-04 23:52:05 Closing chart #5 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #5. | 2018-11-04 23:52:05 Closing chart #4 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #4. | 2018-11-04 23:52:05 Chart #3 in chartbook C:\SierraChart\Data\ChartbookExample.cht already closed. ACSIL function requested to close chart #3. | 2018-11-04 23:52:05 Chart #2 in chartbook C:\SierraChart\Data\ChartbookExample.cht already closed. ACSIL function requested to close chart #2. | 2018-11-04 23:52:05 Closing chart #7 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #7. | 2018-11-04 23:52:05 Closing chart #6 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #6. | 2018-11-04 23:52:05 Closing chart #9 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #9. | 2018-11-04 23:52:05 Closing chart #8 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #8. | 2018-11-04 23:52:05 Closing chart #11 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #11. | 2018-11-04 23:52:05 Closing chart #10 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #10. | 2018-11-04 23:52:05 Closing chart #13 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #13. | 2018-11-04 23:52:05 Closing chart #12 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #12. | 2018-11-04 23:52:05 Closing chart #15 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #15. | 2018-11-04 23:52:05 Closing chart #14 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #14. | 2018-11-04 23:52:05 Closing chart #17 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #17. | 2018-11-04 23:52:05 Closing chart #16 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #16. | 2018-11-04 23:52:05 Closing chart #19 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #19. | 2018-11-04 23:52:05 Closing chart #18 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #18. | 2018-11-04 23:52:05 Closing chart #20 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #20. | 2018-11-04 23:52:05 Closing chart #1 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #1. | 2018-11-04 23:52:05 Chart #14 in chartbook C:\SierraChart\Data\ChartbookExample.cht already closed. ACSIL function requested to close chart #14. | 2018-11-04 23:52:05 Closing chart #21 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #21. | 2018-11-04 23:52:05 Closing chart #23 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #23. | 2018-11-04 23:52:05 Closing chart #22 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #22. | 2018-11-04 23:52:05 Closing chart #25 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #25. | 2018-11-04 23:52:05 Closing chart #24 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #24. | 2018-11-04 23:52:05 Closing chart #27 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #27. | 2018-11-04 23:52:05 Closing chart #26 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #26. | 2018-11-04 23:52:05 Closing chart #29 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #29. | 2018-11-04 23:52:05 Closing chart #28 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #28. | 2018-11-04 23:52:05 Closing chart #31 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #31. | 2018-11-04 23:52:05 ESZ18 9375 Volume #31 | Chart Data Loading Thread: Load canceled. | 2018-11-04 23:52:05 Closing chart #30 in chartbook C:\SierraChart\Data\ChartbookExample.cht. ACSIL function requested to close chart #30. | 2018-11-04 23:52:05 ESZ18 18750 Volume #30 | Chart Data Loading Thread: Load canceled. | 2018-11-04 23:52:05 Chart #19 in chartbook C:\SierraChart\Data\ChartbookExample.cht already closed. ACSIL function requested to close chart #19. | 2018-11-04 23:52:05
Chart #18 in chartbook C:\SierraChart\Data\ChartbookExample.cht already closed. ACSIL function requested to close chart #18. | 2018-11-04 23:52:05 Chart #15 in chartbook C:\SierraChart\Data\ChartbookExample.cht already closed. ACSIL function requested to close chart #15. | 2018-11-04 23:52:05 Chart #14 in chartbook C:\SierraChart\Data\ChartbookExample.cht already closed. ACSIL function requested to close chart #14. | 2018-11-04 23:52:05 |
To post a message in this thread, you need to log in with your Sierra Chart account: