NexusFi: Find Your Edge


Home Menu

 





Can't close triggered Long Limit order


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one vetl with 4 posts (0 thanks)
    2. looks_two Fat Tails with 1 posts (0 thanks)
    3. looks_3 monpere with 1 posts (0 thanks)
    4. looks_4 NinjaTrader with 1 posts (0 thanks)
    1. trending_up 2,472 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

Can't close triggered Long Limit order

  #1 (permalink)
 vetl 
Toronto, Ontario
 
Experience: Beginner
Platform: NinjaTrader
Trading: ES
Posts: 11 since Nov 2011
Thanks Given: 0
Thanks Received: 1

Hi all,

I'm trying to put together template for entry exit logic so it would be easy to code new strategies and got stuck on one portion where I can't close triggered long limit order. So, basically scenario is my 3 long limit orders are being triggered and when I try to to Exit long ninja doesn't close it, here is log from traceorder:


code to place the orders :

Order1 = EnterLongLimit(0,true,LotSize1, ePrice, "Order1");
Order2 = EnterLongLimit(0,true,LotSize2, ePrice, "Order2");
Order3 = EnterLongLimit(0,true,LotSize3, ePrice, "Order3");

Log :


4/10/2012 7:45:00 PM Entered internal PlaceOrder() method at 4/10/2012 7:45:00 PM: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=101.08 StopPrice=0 SignalName='Order1' FromEntrySignal=''
4/10/2012 7:45:00 PM Entered internal PlaceOrder() method at 4/10/2012 7:45:00 PM: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=101.08 StopPrice=0 SignalName='Order2' FromEntrySignal=''
4/10/2012 7:45:00 PM Entered internal PlaceOrder() method at 4/10/2012 7:45:00 PM: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=101.08 StopPrice=0 SignalName='Order3' FromEntrySignal=''


execution event:
Execution='NT-00000' Instrument='CL 05-12' Account='Replay101' Name='Order1' Exchange=Default Price=101.08 Quantity=1 Market position=Long Commission=0 Order='NT-00000' Time='4/10/2012 7:50:00 PM'


Execution='NT-00001' Instrument='CL 05-12' Account='Replay101' Name='Order2' Exchange=Default Price=101.08 Quantity=1 Market position=Long Commission=0 Order='NT-00001' Time='4/10/2012 7:50:00 PM'

Execution='NT-00002' Instrument='CL 05-12' Account='Replay101' Name='Order3' Exchange=Default Price=101.08 Quantity=1 Market position=Long Commission=0 Order='NT-00002' Time='4/10/2012 7:50:00 PM'

here is the code that I'm executing to close orders:
ExitLong("Order1");
ExitLong("Order2");
ExitLong("Order3","");
ExitLong();

result:
4/10/2012 7:50:00 PM Entered internal PlaceOrder() method at 4/10/2012 7:50:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='Order1'
4/10/2012 7:50:00 PM Entered internal PlaceOrder() method at 4/10/2012 7:50:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='Order2'
4/10/2012 7:50:00 PM Entered internal PlaceOrder() method at 4/10/2012 7:50:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='Order3' FromEntrySignal=''
4/10/2012 7:50:00 PM Entered internal PlaceOrder() method at 4/10/2012 7:50:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''


Any suggestion pleaseee ??? I'm trying to close all orders at that time, if there is opposite signal.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Futures True Range Report
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
Exit Strategy
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #2 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

ExitLong() reliably closes orders. If it does not close your orders, there is a problem in your code elsewhere.

As you have not posted the entire strategy, nobody can help you unless you post it.

Reply With Quote
  #3 (permalink)
 vetl 
Toronto, Ontario
 
Experience: Beginner
Platform: NinjaTrader
Trading: ES
Posts: 11 since Nov 2011
Thanks Given: 0
Thanks Received: 1


I did a check with print message, condition is being triggered with "ExitLong" statements, i'm really confused where else can be the problem :S Can you confirm that ExitLong would close triggered LongLimitOrder ? if it is then probably I will need to comment out everything and enable block by block

Started this thread Reply With Quote
  #4 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,371


vetl View Post
I did a check with print message, condition is being triggered with "ExitLong" statements, i'm really confused where else can be the problem :S Can you confirm that ExitLong would close triggered LongLimitOrder ? if it is then probably I will need to comment out everything and enable block by block

Are you sure NT is not ignoring the exits because they might violate their internal order rules? That's one of the reasons I now only use Unmanaged orders. You may want to also open a post on the NT support forum.

Reply With Quote
  #5 (permalink)
 vetl 
Toronto, Ontario
 
Experience: Beginner
Platform: NinjaTrader
Trading: ES
Posts: 11 since Nov 2011
Thanks Given: 0
Thanks Received: 1

Thank you for your input, I don't see any errors related to the internal handling rules in logs. Also another question iOrder object, will it become null after order is closed? or it will still have details from the last order ?

Started this thread Reply With Quote
  #6 (permalink)
 
NinjaTrader's Avatar
 NinjaTrader  NinjaTrader is an official Site Sponsor
Site Sponsor

Web: NinjaTrader
AMA: Ask Me Anything
Webinars: NinjaTrader Webinars
Elite offer: Click here
 
Posts: 1,713 since May 2010
Thanks Given: 203
Thanks Received: 2,686


vetl View Post
Thank you for your input, I don't see any errors related to the internal handling rules in logs. Also another question iOrder object, will it become null after order is closed? or it will still have details from the last order ?

The variable that holds the IOrder object will always contain the object untill you set the variable to null. The IOrder object itself will hold values in its properties for the order.

Follow me on Twitter Reply With Quote
  #7 (permalink)
 vetl 
Toronto, Ontario
 
Experience: Beginner
Platform: NinjaTrader
Trading: ES
Posts: 11 since Nov 2011
Thanks Given: 0
Thanks Received: 1

Thank you for your information! I got Visual Studio for debugging now it became waaay easier. Now I need another word of advice, on how to track\distinguish orders that hit TP and got closed at tp ? For example I have 3 orders rolling with 3 different target prices, orderstatus is filled. But I can't find the way to say which one is filled and which one is not, this is to close any open orders on opposite signal or to know when to clear iOrder objects. Thank you for your help everyone. Should I use opposite stop order to simulate TP ? and when its hit have action done on that event ? Limit order for TP and stop orders for SL ?

Started this thread Reply With Quote




Last Updated on April 26, 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