I am trying to trade with 1000 and 144 Tick charts. 144 is my primary bars. No order is create at all when I insert " Add(PeriodType.Tick, 1000);".
Could anyone advise? Thanks
My code below :
protected override void Initialize()
{
Add(LeaderOfMACD(12, 26, 9));
Add(Stochastics(7, 14, 3));
Add(StochasticsOverlay(7, 14, 3));
Add(EMA(20));
Add(PeriodType.Tick, 1000);
SetStopLoss("", CalculationMode.Ticks, stopLossPts , false);
SetProfitTarget("", CalculationMode.Ticks, profitPts );
CalculateOnBarClose = true;
}
protected override void OnBarUpdate()
{
if (CrossBelow(LeaderOfMACD(BarsArray[1], 12, 26, 9), LeaderOfMACD(BarsArray[1], 12, 26, 9).Avg, 1))
{
boolCrossover = true ;
}
if (boolCrossover == true
&& CrossBelow(LeaderOfMACD(12, 26, 9), LeaderOfMACD(12, 26, 9).Avg, 1))
{
txtRemark = "MACD 1000 and 144 Tick Sell " + DefaultQuantity + " Contract";
EnterShort(DefaultQuantity, txtRemark);
boolCrossover = false;
}
if (Position.MarketPosition == MarketPosition.Short
&& Position.GetProfitLoss(Close[0], PerformanceUnit.Currency) > 100)
{
ExitShortExit Short " + Position.Quantity + " contracts");
}
}
Comment