NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 10-05-2011, 07:51 AM   #1
NoName
Junior Member
 
Join Date: Oct 2011
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
Default Closes position on EnterLong() execution

On real time, this system closed a short position (on 9/23 16:45) on EnterLong() execution. Since then, trades seem to be displaced, trades begin on ExitLong/Short() and end on EnterLong/Short() (see trade on 9/26 11:45 - 9/26 12:30).(see attached image)
Could anyone explain it, please?
Thank you.
The system contains something like:
EnterLong(0,1,"Compra")
EnterShort(0,1,"Venta")
ExitLong(0,1,"Cierro compra","Compra")
ExitShort(0,1,"Cierro venta","Venta")
Attached Images
File Type: png problemas4.png (128.4 KB, 7 views)
NoName is offline  
Reply With Quote
Old 10-05-2011, 08:06 AM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello NoName,

Welcome to the NinjaTrader forum! Unfortunately real time performance does not pair trades according to the signal names used in a strategy. All trades are paired with FIFO, even if they originate from an automated strategy.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 10-05-2011, 09:09 AM   #3
NoName
Junior Member
 
Join Date: Oct 2011
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
Default

So realized PnL on strategies tab is different from real time performance by clicking right button Performance -> Realtime?
NoName is offline  
Reply With Quote
Old 10-05-2011, 09:20 AM   #4
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

No, my response was about trade pairing. Generally PnL should be identical. Are you seeing different in your NinjaTrader?
NinjaTrader_RyanM is offline  
Reply With Quote
Old 10-05-2011, 09:30 AM   #5
NoName
Junior Member
 
Join Date: Oct 2011
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
Default

Yes, i'm seeing different realized PnL. You can see the rare operations on the image I sent you. The realized PnL on strategies tab matches the ("CierroCompra" - "Compra") sum while the realized PnL on Performance->Realtime matches the ("Compra" - "CierroCompra") sum
NoName is offline  
Reply With Quote
Old 10-05-2011, 09:41 AM   #6
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

One explanation for this is that the strategies tab is dynamically updated with each trade, and the real time performance is only updated at the time you request the report. Do they match if you request a new real time performance report?
NinjaTrader_RyanM is offline  
Reply With Quote
Old 10-06-2011, 12:28 AM   #7
NoName
Junior Member
 
Join Date: Oct 2011
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
Default

That's not the problem. I think the problem is induced by 'rare trades'.
NoName is offline  
Reply With Quote
Old 10-06-2011, 03:17 AM   #8
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

NoName, from your original post it seems more like a syncronization issue as you restart the strategy - with which synching options are you working here?
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
When NT closes a position cassb Strategy Development 1 05-26-2010 05:42 AM
SetTrailStop() never closes position Argo1 Strategy Development 11 10-30-2009 09:52 AM
Only entering long position if entry bar closes at high of range newtrader1 Strategy Development 2 03-04-2009 07:34 AM
Strategies stop after position closes ashish Automated Trading 3 11-04-2007 01:24 AM
Strategy in simulation mode: immediately closes position FireFly Strategy Development 11 04-13-2007 04:36 AM


All times are GMT -6. The time now is 12:44 AM.