| 4/11/2024 10:16:41 AM | Default | Strategy 'HATrader4': Error on calling 'OnStateChange' method: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart. |
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Error while trying to create stop order using high or low from 2 bars ago
Collapse
X
-
Error while trying to create stop order using high or low from 2 bars ago
Hi, I'm trying to create a stop order in strategy builder that will create a stop using the entry signal as the trigger and set the stop to either the high or the low from 2 bars ago depending on which direction the order was placed. When I try to enable the strategy it automatically stops and I get an error in the log that reads:I've tried changing it from an indicator based input to a price based but still no luck. Anyone have any ideas on how to rectify this? I'd like to implement the stop this way instead of having it as a standard ticks or points for each entry. -
Hello Kyle B,
Welcome to the NinjaTrader forums!
The Stops and Targets cannot use any data series or indicator values. Instead you would need to use Exit orders in the Actions page from the 'Do the following' section on the Conditions and Actions.
Below are links to examples.
Hello support team, I have 2 dataseries, a 1minute to detect the ATR value. Now I would like to set the stoploss and profit target based on the actual ATR Value Example: Stoploss 2xATR Profittarget 3xATR value 1. How can this be done with builder, I have no coding experience 2. Later I would like to have the possibility toChelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
50 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|
Comment