I need some assistance developing a MTF strategy.
For simplicity assume my primary bar series is 60 min and my secondary bar series is 1 min. I need the strategy to check for a SMA cross over on the primary bar series and then enter a long limit order on the secondary bar series. However the limit order level will be determined by the primary bar series, meaning that Close[0], high[0] and Low[0] are the ones of the 60min bar series.
Is the code below correct? yes/no
protected override void Initialize() { Add(PeriodType.Minute, 1) } protected override void OnBarUpdate() { if (BarsInProgress == 0) { if (CrossAbove(SMA(10),SMA(50),1)) { EnterLongLimit(1,Close[0]-0.35(High[0]-Low[0])); } } }
1 - I am not sure that the EnterLongLimit is coded to do as described above;
2 - I am not sure if the EnterLongLimit will be running for only 1 minute, or for the entire 60 min during which the SMA crossover has occured on the primary bar series
Comment