NexusFi: Find Your Edge


Home Menu

 





IOrders TrailStop


Discussion in NinjaTrader

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




 
Search this Thread

IOrders TrailStop

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

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?
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
About a successful futures trader who didnĀ“t know anyth …
Psychology and Money Management
How to apply profiles
Traders Hideout
 
  #3 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,612 since Aug 2009
Thanks Given: 11,341
Thanks Received: 2,747



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 Twitter 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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts