Has anyone found a way to buy at market close and sell at the opening, every day of the week (ie no day left without a trade)? Thanks for any help .. I have tried the new same-day possibilities without success
Rename
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript1 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { PlaceTrade(bars, TransactionType.Buy, OrderType.MarketClose); PlaceTrade(bars, TransactionType.Sell, OrderType.Market); } } }
Assumes Daily bars.
(Title specified "using Building Blocks")
(Title specified "using Building Blocks")
Thank you Cone, the BB solution leaves 1 gap day. Is it possible to compress to same day marketclose using BB?
Thank you Glitch . Your c# code definitely works !!! Wasn't able to make it work in BB - see prior comments, is it possible in BB?
It doesn't leave a gap day if you set it up like the picture.
(Hint: Multiple Positions)
What's the point of this?
(Hint: Multiple Positions)
What's the point of this?
Thanks much Cone - my bad, I missed Multiple Positions on. All good now !
Your Response
Post
Edit Post
Login is required