NexusFi: Find Your Edge


Home Menu

 





IOrders TrailStop


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one MXASJ with 1 posts (0 thanks)
    2. looks_two Quick Summary with 1 posts (0 thanks)
    3. looks_3 baruchs with 1 posts (0 thanks)
    4. looks_4 DavidHP with 1 posts (0 thanks)
    1. trending_up 2,212 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 801

I'm sure there is already an elegant solution to this, but what are those of you using IOrders in Ninja doing for a TrailStop?

I came up with this which runs in OnBarUpdate:

 
Code
if (Position.MarketPosition == MarketPosition.Long)
{
int myHi = HighestBar(High, BarsSinceEntry(0, "Entry 1a",0));
double myValueLong = High[myHi];
double stopValueLong = myValueLong - stopLoss * TickSize;

stopOrder1 = ExitLongStop(stopValueLong, "MyTrailStop", "Entry 1a");
}
Which kind of works... but what has been working well for others? Thanks!


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Expiration Day: Wall Street Rallies on Peace Hopes While …
Prediction Markets & Event Contracts
CFTC Chair Selig Puts Timeline on US Crypto Perpetual Fu …
Cryptocurrency
The Backwardation Signal: How the CL Futures Curve Tells …
Commodities
MegaETH Proves the Crowd Right: Prediction Markets Calle …
Prediction Markets & Event Contracts
CFTC Workforce Shrinks 24% to 15-Year Low While Predicti …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: NQ / ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,801 since Aug 2009
Thanks Given: 11,742
Thanks Received: 3,018



MXASJ View Post
I'm sure there is already an elegant solution to this, but what are those of you using IOrders in Ninja doing for a TrailStop?

I came up with this which runs in OnBarUpdate:

 
Code
if (Position.MarketPosition == MarketPosition.Long)
{
int myHi = HighestBar(High, BarsSinceEntry(0, "Entry 1a",0));
double myValueLong = High[myHi];
double stopValueLong = myValueLong - stopLoss * TickSize;

stopOrder1 = ExitLongStop(stopValueLong, "MyTrailStop", "Entry 1a");
}
Which kind of works... but what has been working well for others? Thanks!

MXASJ Did you come up with any other solutions?

Thanks,


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on X Reply With Quote
  #4 (permalink)
 baruchs 
Israel
 
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
Posts: 323 since Jun 2009

This is also what I do. I don't see why its not the best solution possible.
Only one correction:
I believe that it changes the actual stop order, then don't give it a new name "MyTrailStop", in live trading it won't work.


Reply With Quote




Last Updated on January 13, 2012


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts