NexusFi: Find Your Edge


Home Menu

 





Reversing A position


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one NJAMC with 3 posts (1 thanks)
    2. looks_two Big Mike with 2 posts (1 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Silver Dragon with 1 posts (1 thanks)
    1. trending_up 4,378 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

Reversing A position

  #1 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,970 since Dec 2010
Thanks Given: 3,037
Thanks Received: 2,394

Sorry for the simple question, but I can't find the concrete answer off-hand.

I am looking to reverse a position in one bar using the built in NT7 functions. I can do this unmanaged trading but don't have time to setup LOM right now. I am hoping someone can spell this out as it is not straight forward without causing an over-fill or exiting on one bar and the entering on the next bar.

What I would like to do for example is to go from one contract Long to one contract Short with market orders.

So during one bar, I have entered long with:
EnterLong();

So now I am Long and want to reverse the position so I tried the obvious with simply triggering:
EnterShort();

Unfortunately, this seem to only Sell 1 contract leaving me flat, similar to "ExitLong()" would have done. Do I need to
EnterShort(2);

I am pretty short, I get an error if in the same bar I call both Exit and Enter:
ExitLong();
EnterShort();

Thanks, hopefully @Fat Tails has a quick answer here.... I have certainly lost touch with the build in nuanced of NT7 Order Management...

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Deepmoney LLM
Elite Quantitative GenAI/LLM
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541


The way I did it a few years ago was to use a 1 range secondary series and submit orders to it. So every tick price moves I can enter or exit.

Maybe a better way?

Sent from my LG Optimus G Pro

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,970 since Dec 2010
Thanks Given: 3,037
Thanks Received: 2,394


Big Mike View Post
The way I did it a few years ago was to use a 1 range secondary series and submit orders to it. So every tick price moves I can enter or exit.

Maybe a better way?

Sent from my LG Optimus G Pro

@Big Mike,

Thanks, I already have a second and third series. I could probably add a 4th, but it would be nice to know how to do this right...

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541


NJAMC View Post
@Big Mike,

Thanks, I already have a second and third series. I could probably add a 4th, but it would be nice to know how to do this right...

If you equate "right" to "NinjaTrader submitting an Entry, Exit, and another Entry order, all on the same bar series" then I believe @NinjaTrader Ray will confirm that is not possible. But hey I could be wrong, so maybe someone else has a better idea than using the 1-range secondary series. Obviously if you are really fanatical about it you could use a 1-tick series, but it is far more expensive.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
Silver Dragon's Avatar
 Silver Dragon 
Cincinnati Ohio
Legendary Master Data Manipulator
 
Experience: Intermediate
Platform: TastyWorks / NT
Broker: TastyWorks /NT
Trading: FX, Stocks, Options
Posts: 2,107 since Feb 2011
Thanks Given: 6,422
Thanks Received: 5,238


NJAMC View Post
Sorry for the simple question, but I can't find the concrete answer off-hand.

I am looking to reverse a position in one bar using the built in NT7 functions. I can do this unmanaged trading but don't have time to setup LOM right now. I am hoping someone can spell this out as it is not straight forward without causing an over-fill or exiting on one bar and the entering on the next bar.

What I would like to do for example is to go from one contract Long to one contract Short with market orders.

So during one bar, I have entered long with:
EnterLong();

So now I am Long and want to reverse the position so I tried the obvious with simply triggering:
EnterShort();

Unfortunately, this seem to only Sell 1 contract leaving me flat, similar to "ExitLong()" would have done. Do I need to
EnterShort(2);

I am pretty short, I get an error if in the same bar I call both Exit and Enter:
ExitLong();
EnterShort();

Thanks, hopefully @Fat Tails has a quick answer here.... I have certainly lost touch with the build in nuanced of NT7 Order Management...


You could try this; Double the position size to take out the current position and enter a new one.

 
Code
if (Position.MarketPosition == MarketPosition.Long)
					{
					EnterShort(2, "Reverse");	
					}


Robert

nosce te ipsum

You make your own opportunities in life.
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #7 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,970 since Dec 2010
Thanks Given: 3,037
Thanks Received: 2,394


Silver Dragon View Post
You could try this; Double the position size to take out the current position and enter a new one.

 
Code
if (Position.MarketPosition == MarketPosition.Long)
					{
					EnterShort(2, "Reverse");	
					}


Robert

Thanks @Silver Dragon,

This seems to work, just need to add an else statement to fire a single order if not Long.

Hopefully this is something that gets clarified with NT8.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:




Last Updated on September 17, 2013


© 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