protected override void Initialize()
{
SetProfitTarget("", CalculationMode.Ticks, TP);
SetStopLoss("", CalculationMode.Ticks, SL, false);
Add(PeriodType.Minute, 3);
Add(PeriodType.Minute, 5);
Add(PeriodType.Minute, 15);
CalculateOnBarClose = false;
}
protected override void OnBarUpdate()
{
if (
Rising(SMA(Typical, 1)) == true
&& Rising(SMA(Typical, 3)) == true
&& Rising(SMA(BarsArray[1], 3)) == true // <---- I want to check type "Typical", not type "Close"
&& Rising(SMA(BarsArray[2], 3)) == true // <---- I want to check type "Typical", not type "Close"
&& Rising(SMA(BarsArray[3], 3)) == true // <---- I want to check type "Typical", not type "Close"
&& SMA(Typical, 1)[0] > SMA(Typical, 3)[0] // <---- This I want to check on higher TF, too, but how with type "Typical" ????
&& Rising(EMA(13)) == true
&& Rising(SMA(20)) == true
&& Rising(SMA(50)) == true
&& EMA(13)[0] > SMA(20)[0]
&& (EMA(BarsArray[1], 13))[0] > (SMA(BarsArray[1], 20))[0]
&& (EMA(BarsArray[2], 13))[0] > (SMA(BarsArray[2], 20))[0]
&& Position.MarketPosition == MarketPosition.Flat
&& (Opens[3][0] < Closes[3][0])
&& Low[0] <= EMA(13)[0] + 1 * TickSize
)
{
EnterLong(DefaultQuantity, "");
}
}
Comment