Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
at the moment I backtest my system and try to find an appropriate exit strategy.
I use ACSIL Programming Concepts and have Tick Data available.
After a backtest I check the results using Trade Activity Log, especially columns Profit/Loss, Runup, Drawdown.
I can see that there are sometimes huge price gaps between the price that fulfills my exit condition and the price shown in the trade log. This makes it impossible to test and optimize exit strategies like trailing stops for me.
Example:
I use a trailing stop of 100$ based on the Runup in the code, e.g. stop = runup - $100.
Even if the position is in profit with runups way beyond $100, I see losses in the P&L row after the backtest
that are beyond any tolerance bands acceptable or slippage.
It seems that the price in the log is always the close price of the bar after the exit condition was fulfilled.
Of course if this is a huge bar the price can be way away from my exit condition.
I use Auto Trade System Bar Based Backtest for this because it is relatively fast.
If I use Auto Trade System Replay Backtest it is extremly slow and also the values recorded in Trade Activity Log seem to be wrong, e.g. in Runup column I see huge runups that do not correspond with the charts and are not identical with the runups when I used Bar Based Backtest, e.g. Bar Based Runup = $ 300, Replay Runup = $ 3995
for the same trade.
Another issue I had with Sierra Chart while backtesting was regarding to the position sizing.
I use an algo to determine position size depending on my risk per trade and the following code:
NewOrder.OrderQuantity = Quantity;
Quantity is a variable filled by the algo mentioned above, e.g. 3 contracts.
When I have quantities > 1 I can see partial order fills while backtests in the trade log when my exit conditions are met, e.g. 3 fills at the same time.
Since my code does not use any scaling out methods and since I always exit on the full position size this is very strange (no help from support).
Maybe someone of the forum users can give me an advice if it makes sense to proceed with Sierra Chart
in general for serious trading systems development.
It sounds like you shouldn't use the bar-based backtest if you need trades to execute mid-bar. Not sure about the other issues. I hope you find a solution. I am getting used to backtesting in SC also.
I think a lot of people must be looking for general SC backtesting info or something.
If there are any SC vets here that use the platform for automation or have extensive backtesting experience with it I would be interested in talking to you.
I have worked with the bar based backtest in Sierra for a couple of weeks and I’ve convinced myself that it can be wildly inaccurate. The tick by tick replay is supposed to be much more accurate, but I’m still trying to figure out how to make it run consistently.
Happy to collaborate on this, LittleFinger.
Anyone with a similar interest is free to message me.
I'm glad you brought that up. It is unfortunate the way that the bar-based backtest calculates to distort your results to make them look much better.
From what I've seen, if your exit rules can calculate mid bar, then absolutely do not use the bar-based backtest. It will determine the absolute best price to get you out of the trade, even if it was impossible for you to be filled at that price. It will dramatically inflate the results of any backtest that does mid-bar calculations for entry or exit.
However, if you add sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_CLOSED to your exit logic then you can get close results on the bar based backtest to what you get on a replay test, but there will be some imperfections.
This is an important point to reiterate for anyone else. Setting sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_CLOSED was absolutely critical to prevent the awarding of prices from the before the open point of the bar.
Even so, I found that the "logic" (which is documented) is not really what I want, from the bar based testing. I asked Sierra to give users the ability to control how fills are made, but they have so far studiously avoided even responding to the request.
If you or anyone else would like to be able to control exactly how fills are awarded in your bar backtest, please add a comment in support here:
I agree that some options on the bar based logic would be nice.
I'm currently trying to figure out the best method to limit a strategy to one trade a day.
I was thinking compare current day with day of last fill, but not sure how to get the current day on the chart for backtesting and not actual current day.