Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 06:12:00 +0000



Post From: ACSIL Drawing Problem/Question

[2015-03-15 17:23:11]
StevieD - Posts: 39
1) An obvious problem exists in this line of code...

if ((Hour == 8) && (Minute = 25) )

2) I use the message log for debugging and noticed that when I wrote the price levels out to the log before I added the drawing tool portion the message would get repeated 5 or so times each bar that the condition was true.

Charts update (and code runs) based on the chart update interval setting. This is true whether using auto-looping or manual looping. Your explanation indicates you are using auto-looping. Two options come to mind to control when your code runs, which would/should also create generic code usable on multiple timeframes without mod.

The first option is sc.GetBarHasClosedStatus() found here... http://www.sierrachart.com/index.php?page=doc/doc_ACSIL_Members_Functions.html#scGetBarHasClosedStatus

The second option uses a persistent variable for one-time processing per bar, found here... http://www.sierrachart.com/index.php?page=doc/doc_ACSILProgrammingConcepts.html#OneTimeProcessingperBar

Good trading to you