I'd like to enter a long trade 2 ticks above the close of the signal bar. The challenge that I am running into are:
1. How to create a code that helps me to enter at a price 2 ticks above the close of the signal bar
2. At times the market may move up 2 ticks during the very next bar after the signal bar OR it may hover around for next 5 bars and then moves up in my direction. In this case, how do I make sure that NT is able to remember the long signal even though it occurred number of bars ago.
I wrote a code after going through NT help manual, but it is not placing any trade at all. I am copying the code that I have and greatly appreciate if you can help me to figure out:
1. How to go long at 2 ticks above the close of the signal bar
2. In case the market does not move up by 2 ticks during the next bar after the signal bar, how to make sure NT will do so as long as long conditions are still prevailing and will enter a trade if the market continues to move higher after 3 or 4 or 5 bars after the signal bar
protected override void Initialize()
{
EntriesPerDirection = 1;
SetProfitTarget(CalculationMode.Ticks, profittargetticks1);
SetStopLoss(CalculationMode.Ticks, stoplossticks);
Add(PeriodType.Minute, higherperiod);
CalculateOnBarClose = true;
}
protected override void OnBarUpdate()
{
//Long Entry
if (VsTWPColor(wave).Power5[0] >= 1
&& (VsTWPColor(wave).Power5[0] <= 2
&& AAATS_TrendWithPower(wave).TrendUp.ContainsValue(0 )
&& AAATS_TrendWithPower(BarsArray[1],highertimewave).TrendTicksCount[0]>=1
&& AAATS_TrendWithPower(BarsArray[1],highertimewave).TrendTendance[0]>=1
&& (ToTime(Time[0]) >= 83000 && ToTime(Time[0]) <= 150000)
&& entryOrder == null))
{
entryOrder = SubmitOrder(1, OrderAction.Buy, OrderType.StopLimit, 1, Close[0] + 2*TickSize, Close[0] + 2*TickSize, "", "Long 1");
}
Comment