A Friday-Timed Gold Long Strategy and Its Code Caveats
Summary
This gold strategy is presented as a test of a weekday timing effect. Its description says to enter a long position at the start of Friday trading and exit near Friday’s close, with user-adjustable backtest dates. The stated defaults allocate 10% of equity per trade and include slippage and commission assumptions. The document offers no performance statistics or evidence that the proposed seasonal pattern persists.
The code warrants careful inspection before treating the description as an account of its behavior. Its entry condition checks for dayofweek equal to 4, which does not correspond to Friday in Pine Script’s weekday numbering, and the exit condition is evaluated on every bar because the counter is always divisible by 1. Thus, the implementation appears inconsistent with the prose description of a Friday-to-close holding period. Session variables and a Friday flag are defined but do not control the actual entry or exit. The script should be verified on the intended chart and timeframe before any backtest conclusions are drawn.
Key ideas
- The described hypothesis is to hold a long gold position from Friday’s session start toward its close.
- The script provides date controls and specifies equity sizing, slippage, and commission assumptions.
- The entry condition uses a weekday value that appears inconsistent with the stated Friday rule.
- The exit condition is true on every bar, so the code may not implement the described holding period.
- No results are provided to support the claimed weekday anomaly.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.