Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Low price in time range
Collapse
X
-
Gotcha. If I'm looking at futures and have my entries starting at 930am but I have a condition looking at the low of the bar from 830-930am it's not gonna give me any trades is it? Because it's previous to my entry cutoff and doesn't meet min bars required. Or if not there must be another reason I'm getting 0 trades.
Comment
-
It's ES. Primary is 1min and I have all the added series below. Bar checks are below. I changed minLookback to sigBarlow. And I took out MIN and just made it double sigBarlow = Lows[4][0]; seeing I'm only looking at 1 bar. I was getting a lot of trades previous but with adding
if(ToTime(Time[0]) == 93100)
{
double sigBarlow = Lows[4][0];
}
I'm not getting any trades....
Code:public class FuturesNew1130 : Strategy { #region Variables private double sigBarlow = 0; #endregion protected override void Initialize() { //Primary 40min //1min Add("ES ##-##",PeriodType.Minute, 5); //Index 1 //10min Add("ES ##-##",PeriodType.Minute, 10); //Index 2 //30min Add("ES ##-##",PeriodType.Minute, 20); //Index 3 //Hour Add("ES ##-##",PeriodType.Minute, 60); //Index 4 //Day Add("ES ##-##",PeriodType.Minute, 150); //Index 5 CalculateOnBarClose = true; EntriesPerDirection = 1; SetStopLoss("EnterShort", CalculationMode.Ticks, 85, true); SetProfitTarget("EnterShort",CalculationMode.Ticks, 80); } protected override void OnBarUpdate() { //Entry Conditions if(ToTime(Time[0]) == 93100) { double sigBarlow = Lows[4][0]; } if ((BarsInProgress == 3) && (BarsSinceEntry(0,"",0) > 40 || BarsSinceExit(0,"",0)==-1) && (CurrentBars[0] >= 2) //1min && (CurrentBars[2] >= 2) //10min && (CurrentBars[3] >= 1) //20min && (CurrentBars[4] >= 2) //600min && Volume[0] > 80000 && Volume[0] > Volume[1]) { if(ToTime(Time[0]) >= 93000 && ToTime(Time[0]) <= 110000 && Opens[0][0] - Closes[0][0] <= 3.25 && Close[0] < Open[0] - 1.25 && Falling(SMA(BarsArray[0], 190)) && Closes[0][0] < SMA(BarsArray[0], 190)[0] && Closes[0][0] < SMA(BarsArray[0], 65)[0] && Closes[0][0] < sigBarlow && ATR(BarsArray[4], 14)[0] > 4 && Close[0] < PriorDayOHLC().PriorHigh[0]) { EnterShort(0, 1, "EnterShort"); Print(sigBarlow + "sigBarlow"); } } //ShortExit if((BarsInProgress == 2) && Position.MarketPosition == MarketPosition.Short && Closes[0][0] < Position.AvgPrice - (TickSize*15) && Close[0] > Open[0] + 2.5) { ExitShort(0, 1, "UpCandle", "EnterShort"); } if (Position.MarketPosition == MarketPosition.Short && ToTime(Time[0]) >= 113000) { ExitShort(0, 1, "ExitTime", "EnterShort"); } if ((BarsInProgress == 1) && Position.MarketPosition == MarketPosition.Short && CrossAbove(SMA(13), SMA(38), 1))//13&38 { ExitShort(0, 1, "SMAExit", "EnterShort"); } if((BarsInProgress == 0) && Position.MarketPosition == MarketPosition.Short && BarsSinceEntry(0, "", 0) <= 20 && Closes[0][0] < Position.AvgPrice - (TickSize*26))// { ExitShort(0, 1, "TimeCutS", "EnterShort"); } }
Comment
-
I don't know I think that statement is doing something strange like only allowing trades at 930 exactly. I'm just going to use this statement below, although long, I'm comfortable it's doing what I intend. My entry time is between 930 and 11, so depending on what time it is I'm checking for the current price to be below the low of 830-930 bar. My index 4 is a 60min bar and index 3 is a 30min bar...
If (ToTime(Time[0]) > 93000 && ToTime(Time[0]) <= 100000 && Closes[0][0] < Lows[4][0]
|| ToTime(Time[0]) > 100000 && ToTime(Time[0]) <= 103000 && Closes[0][0] < Lows[3][1]
&& Closes[0][0] < Lows[3][2]
|| ToTime(Time[0]) > 103000 && ToTime(Time[0]) <= 110000 && Closes[0][0] < Lows[4][1]))
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
633 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment