NexusFi: Find Your Edge


Home Menu

 





IOrders not firing correctly?


Discussion in NinjaTrader

Updated
    1. trending_up 1,174 views
    2. thumb_up 2 thanks given
    3. group 0 followers
    1. forum 1 posts
    2. attach_file 1 attachments




 
Search this Thread

IOrders not firing correctly?

  #1 (permalink)
 
SodyTexas's Avatar
 SodyTexas 
Austin TX
 
Experience: Advanced
Platform: Ninjatrader, Python, & R
Broker: RJO
Trading: Futures, Spreads
Posts: 421 since Sep 2013
Thanks Given: 117
Thanks Received: 1,085

Hey nexusfi.com (formerly BMT) friends,

I am running into a issue with a strategy that is not firing a market order when I want it to. The code scales out of a position based on a signal ("sorry not going to say what it is") multiple times as the trend develops. The same code fires for each trade except sometimes it just does not fire.

(See attached image)


The system goes short 10 CL ##-## (market replay) and scales out a total of 5 contracts in 3 trades just as I wanted it too. However, the fourth trade to scale out 2 more contracts it does not fire. The bars are painted to show when it should be firing and the text Fire 2 is right next to the exitShort logic to show me that the code is running properly.

Here is the code that has the ExitShort syntax.

 
Code
if(Position.Quantity > ShortQty)
	{
	        int newposition = Position.Quantity - ShortQty;
	        //exitShort = ExitShort(newposition);
	        exitShort = ExitShort(newposition,"Buy to Close","Sell to Open");
	        if(exitShort == null)
			{
				DrawText("Qty2","Fire " + newposition,3,Low[0],Color.White) ;
			} else DrawText("Qty2","Not Null",3,Low[0],Color.White) ;	
		}
				
		if(Position.Quantity == 1 && exitShortStop != null && BarsSinceExit() > 1)
		{
			exitShort = ExitShort("Buy to Close","Sell to Open");
		}
          }
if you look at the chart again, you will also see that all my IOrder objects are properly set to null except for the stop, which is expected.

I can't see any logical reason why Ninjatrader is skipping exit logic, so I need your help to see if someone has ran into this before.

FYI, this is using the Managed approach IOrder with on execution.

Cheers,

Sody

"The great Traders have always been humbled by the market early on in their careers creating a deep respect for the market. Until one has this respect indelibly engraved in their makeup, the concept of money management and discipline will never be treated seriously."
Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Are there any eval firms that allow you to sink to your …
Traders Hideout
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
  #2 (permalink)
 
SodyTexas's Avatar
 SodyTexas 
Austin TX
 
Experience: Advanced
Platform: Ninjatrader, Python, & R
Broker: RJO
Trading: Futures, Spreads
Posts: 421 since Sep 2013
Thanks Given: 117
Thanks Received: 1,085

SOLVED

Issues with [AUTOLINK]Market Order[/AUTOLINK] - [AUTOLINK]NinjaTrader[/AUTOLINK] Support Forum

Cheers,

Sody

"The great Traders have always been humbled by the market early on in their careers creating a deep respect for the market. Until one has this respect indelibly engraved in their makeup, the concept of money management and discipline will never be treated seriously."
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:




Last Updated on October 16, 2014


© 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