Good evening everyone!
I downloaded the test software yesterday and already have a few questions.
1. I developed a very simple single-trade strategy for SPY. This strategy involves buying SPY on the 24th of each month and selling it again after 16 days.
My questions are:
What settings do I need to configure so that the backtest buys at the closing price on the signal day?
What settings do I need to configure so that the backtest buys at the open price the day after the signal day?
I encountered some problems while running the backtest that I don't understand.
1. I started the backtest on January 2, 2010. The system should have first bought SPY on January 24, 2010. However, the first purchase didn't occur until February 25, 2010, at a price of 109.35. With a starting capital of 100,000, 914 units should have been purchased, but only 902 were actually acquired. Why?
The setting is 100% equity.
The next purchase didn't occur until May 25, 2010. Why not March 25, 2010? This pattern continues. By December 2025, only 56 transactions had been executed, although with a purchase on the 24th of each month and a holding period of 16 days, there should have been approximately 190 transactions.
What happens in the backtest if the 24th of a month falls on a Saturday, Sunday, or public holiday?
Could you explain what I might have done wrong to cause this unusual result in the backtest?
Best regards
I downloaded the test software yesterday and already have a few questions.
1. I developed a very simple single-trade strategy for SPY. This strategy involves buying SPY on the 24th of each month and selling it again after 16 days.
My questions are:
What settings do I need to configure so that the backtest buys at the closing price on the signal day?
What settings do I need to configure so that the backtest buys at the open price the day after the signal day?
I encountered some problems while running the backtest that I don't understand.
1. I started the backtest on January 2, 2010. The system should have first bought SPY on January 24, 2010. However, the first purchase didn't occur until February 25, 2010, at a price of 109.35. With a starting capital of 100,000, 914 units should have been purchased, but only 902 were actually acquired. Why?
The setting is 100% equity.
The next purchase didn't occur until May 25, 2010. Why not March 25, 2010? This pattern continues. By December 2025, only 56 transactions had been executed, although with a purchase on the 24th of each month and a holding period of 16 days, there should have been approximately 190 transactions.
What happens in the backtest if the 24th of a month falls on a Saturday, Sunday, or public holiday?
Could you explain what I might have done wrong to cause this unusual result in the backtest?
Best regards
Rename
By default WL generates signal on the close of one bar and enters on the next open. That's why your order is placed on the 25 Feb (2010 24 Jan is a Sunday so no trade. On average each year you have 8-9 trades due to this)
Try this


Try this
Buy on the 24th on close
I understand everything.
Is it actually possible to use the last trading day of the month as the entry point instead of the actual trading day itself?
Is it actually possible to use the last trading day of the month as the entry point instead of the actual trading day itself?
QUOTE:
Is it actually possible to use the last trading day of the month as the entry point instead of the actual trading day itself?
I have C# strategies that do this. Just tried with blocks. Change the parameter of the OffsetInd you should be able to entry on the Nth day from month begin or to month end.
Entry on first day of month
Entry on last day of month
Note: the above blocks works in backtest and gives correct result. However since it uses "-1 bars ago" it does not generate signals for the next day (e.g if today's 9th and you want to enter on 10th, it does not generate a signal if you run it today). There might be other better ways to do this
thanks
also be careful with 100% position sizing, give yourself a little margin like 1.1 so you can still get into the position if prices gap up. The entry price is based on the closing price of the signal bar.
Your Response
Post
Edit Post
Login is required