Support Board
Date/Time: Tue, 04 Mar 2025 11:37:29 +0000
Short Trades Placed by Long Only Spreadsheet system?!
View Count: 877
[2021-11-19 18:28:17] |
WickedTrader - Posts: 14 |
I have a long-only strategy I have been putting together as a spreadsheet system. Column K is the only one used - LM and N are all empty - exits are based on bracket orders. When I run a scan based backtest (7 stocks), I am getting several Short trade results! I can't even think how this would happen to start to troubleshoot it? I seem to get different results every time I run it too - maybe something is corrupted? I have restarted the application... It seems to relate to big gaps taking the price over the buy stop entry, but surely a Buy Stop order will never be sent as a Sell Stop even if it has gapped over the entry price before the order gets placed? Has anyone seen this before? - screenshot attached (note backtesting results with numerous Shorts despite empty column LM and N!)... I think something is thoroughly corrupted in fact - this has been working fine to date. Maybe suggestions on how to reset SC? - I did a restart, and cleared all trade sim data. Doc Martin |
![]() |
[2021-11-20 16:01:08] |
Sawtooth - Posts: 4179 |
In the Trade Activity Log, change from [SIM]All Symbols to [SIM]SQ
|
[2021-11-20 21:12:08] |
WickedTrader - Posts: 14 |
Thanks Tom, but SQ is just one of the watchlist I am backtesting 'with Scan'. I'm assuming you were thinking that I was looking at multiple old results that were confusing me? I am fully resetting the system before I run the scan based backtest too - Trade Menu : Clear Trade Simulation Orders and Data... If I'm misunderstanding or you have any more ideas please do let me know. As further troubleshooting, I just tried to compare a series of individual (rather than bulk with-scan) stock bar-based backtests... I wanted to see if they had the same problem. After running through twenty stocks (clicking next file, Autotrade BB Backtest, repeat...)... I got have way down my watch list and paused to look at the results and only 5 or 6 of them had logged at all! I then repeated one simple bar based back test several times and got different results each time!? Is my installation corrupted or something? Doc Martin Date Time Of Last Edit: 2021-11-20 21:21:54
|
[2021-11-20 23:39:50] |
Sawtooth - Posts: 4179 |
I'm assuming you were thinking that I was looking at multiple old results
That was my assumption.I personally don't like the Bar Based Back Test. - It won't work with multiple charts using overlaid studies. - It doesn't seem to work well with intrabar signals, nor with exits via Attached Orders. - It seems less accurate with short duration bars and bars that are not time-based. - It seems to only work well with long duration time-based bars with close-of-bar entries and exits. IMO the most accurate backtest is a manual Replay Chart using Accurate Trading System Back Test Mode, with a very short Processing Step. This usually means that the test is exceedingly slow, compared to the Bar Based Back Test. So I would suggest you try using a manual Replay Chart on one of the symbols to confirm that your system is signalling accurately. Auto Trade System Back Testing: Replay Back Testing - Manual |
[2021-11-21 11:51:43] |
WickedTrader - Posts: 14 |
Thanks for that, I have heard similar before, and I have had more consistent results with replay-based myself. Interesting that you say attached orders don't work well on BB backtests - maybe that's my problem, the rest doesn't worry me. The problem is that I want to test 10 stocks over a year of 39m charts, signals only on bar closes. To do that in less than a day of computing I will need 3840+ replay speed, and I've been told that fast replays give false results too? It doesn't allow watchlist scans either, but I guess I could open ten separate charts in the book... How do you know if you've gone too fast? - I can't just turn it up to max can I? Doc P.S. Thanks for the dialogue - I'm working with a group teaching Algo. We really want SC to work and be our main system, but we all still have lots to learn! Date Time Of Last Edit: 2021-11-21 11:54:44
|
[2021-11-21 13:05:39] |
Sawtooth - Posts: 4179 |
How do you know if you've gone too fast? - I can't just turn it up to max can I?
My 'rule of thumb' is: It is too fast if it overwhelms the video. IOW, it's too fast if the video lurches.Even with this rule of thumb, periods of extreme volatility can still cause unexpected results. So you'll want to choose a speed that works with the symbol's usual price movement. |
[2021-11-21 13:23:04] |
WickedTrader - Posts: 14 |
Thanks - I've learned a few things... I think the results from my bar-based back tests were just insanely wrong! I found the way to plot trade entries, exits, and connecting lines (as below)... ... and the bar-based system was missing exits (mainly) by days (on a 39m chart)! At least I am learning how to test with the replay system properly now. It is going to take a lot more work, but there seems no other way around it. Thanks for your help. Doc Notes for anyone else that hasn't learned the following already... To add lines representing trades (entries, exits and a connection)... Enable Trade : Show Order Fills AND Chart Trade Settings : [Order Fills] Display Entry Exit Connecting Lines |
[2021-11-21 16:01:29] |
|
You can look at the Trade Activity Log and confirm, that the submission of orders were the result of Long Entry: Trade Activity Log: Viewing Historical Trade Activity You need to look at the Order Action Source field. You next need to examine all of the order fill matching to understand what is happening and set the starting Date-Time properly according to the first fill: Trade Activity Log: Understanding and Setting the Start Date-Time for a Trades List Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2021-11-23 14:19:40
|
[2021-11-30 00:04:24] |
WickedTrader - Posts: 14 |
Ok, those links seem to relate mostly to errors with broker fill matching, missing fills and maybe filtered entries / exits. I am simulating all these trades after clearing all data, and I have not filtered off the start or end, so I'm not sure how that explains it? I have found that all the short trades are logged as filled with entry and exit times identical except in the ?microseconds field - e.g. A trade logged as a short with entry at 2020-01-14 13:24:00.000000 and exit at 2020-01-14 13:24:00.000005 Those time differences are only seen in the Trade Activity logs - the Trades log truncates to XX:XX:XX.000 for entry and exit. I assume that this means the trade entered and exited within one candle. Why that should result in a long trade being logged as a short, I still do not understand. The trade activity logs shows corresponding SELL STOP entry and BUY STOP EXIT - as you would expect for a short. Both the entry and exit are listed as 'Open' though (I presume that means that the logs considered them as STO and BTO trades) though, not STO followed by BTC. This is simulated trading, there should be no issues with the open and close trades failing to be matched, surely? Or is that the problem - SC is failing to match the simulated trade entries with their respective exits? - if so, is there a fix? Can someone explain? Or at least tell me what I need to do to stop bar based backtests from simulating short trades in a long-only strategy and giving erroneous results? All replay based backtests work fine! You mentioned the order action source - These are just listed as Trade Simulation Fill Bid XXX Ask XXX Last XXX etc... I'm, not sure what that tells me about the erroneous short trades? |
To post a message in this thread, you need to log in with your Sierra Chart account: