Support Board
Date/Time: Sat, 08 Feb 2025 21:51:21 +0000
Trade Activity Log and sc.BaseData[SC_LOW][] in the context of simulated trades
View Count: 577
[2020-07-30 21:23:15] |
User279534 - Posts: 4 |
Hi, I had two questions: 1) When I do my backtests, I have a couple SCSubgraph objects for the purpose of drawing arrows at the high of a bar (on trade exits) and at the low of a bar (on trade entries). The entry Subgraphref uses sc.BaseData[SC_LOW][sc.Index] and the exit Subgraphref uses sc.BaseData[SC_HIGH][sc.Index]. The exit arrows work great. The entry arrows work most of the time, but a not insignificant of the time they will be drawn at the high of the bar instead of the low of the bar. I've even seen a couple drawn at each of the open and close of a bar. I'm confused as to why this is happening, and I can't find anything pertaining to this issue in the documentation. It's particularly confusing because, as mentioned, the exit arrows are consistently drawn where they're supposed to be drawn. Is it possible that the sc.BaseData[SC_LOW] array will sometimes contain a price that is not a low? It doesn't seem likely because, if I don't condition the drawing of the arrow on a successful order entry, the arrow will get drawn properly every single time. I just don't know what could be causing the object to be drawn at locations other than the low in my backtests, especially since references to some of those arrays (sc.Close[] and sc.Open[]) don't even exist in my code. 2) The date for a trade entry in the trade activity log gives the date one day prior to the trade being taken, but the time is after market close. Ex. A trade is entered on May 23, 2020 (according to my message log and arrows), but the trade activity log says the trade was entered on May 22, 2020 at 6pm (18:00:00. This time will also be 17:00:00, at times. It depends on whether or not the simulated trade is occurring during the DST portion of the year). Is this maybe a global settings clock issue? It's not a major concern, I'd just like the dates in the message log and the activity log to be consistent. The message log gets its date from sc.BaseDateTimeIn[sc.Index].GetDateYMD(Year, Month, Day) and posts a message every time a trade is successfully initiated. I've uploaded an image to help with the first question, which can be found here: http://www.sierrachart.com/image.php?Image=1596142955839.png As can be seen in the image, there are three entry arrows (in this study, entries are randomly generated). The first two are drawn at the low, as they should be, but the one at the right edge is drawn at the close. Neither sc.BaseData[SC_LAST][sc.Index] nor sc.Close[sc.Index] is present anywhere in the code for this study. I would've liked to include a picture to help with the second q as well, but I'm not sure how to get a picture of the message log and the trade activity log at the same time using the tools I have through Sierra Chart. Date Time Of Last Edit: 2020-07-30 21:50:30
|
To post a message in this thread, you need to log in with your Sierra Chart account: