Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Prevent trading into support or resistance
Collapse
X
-
Hello rafe0304, and thank you for your question.
To prevent the managing order from SetProfitTarget from being submitted if its profit target would cross a price point, you could use code such as the following :
Please let us know if there are any other ways we can help.Code:[FONT=Courier New] int profitTargetTicks = 5; // example double myResistanceLine = SMA(14); // example // this example assumes we enter on the long side of the market if(Close[0] + profitTargetTicks * TickSize > myResistanceLine) { return; }[/FONT]Jessica P.NinjaTrader Customer Service
-
Hello rafe0304,
Since CrossAbove and CrossBelow both have an overload in this form :
CrossAbove(IDataSeries series1, double value, int lookBackPeriod)
Provided you pass the price point that the profit target would be at as the value parameter, you can certainly use CrossAbove and CrossBelow to compare your price point to a data series. You will want to use your resistance line as the data series in this example.Jessica P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
77 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
45 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
27 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
32 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
63 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment