NexusFi: Find Your Edge


Home Menu

 





Get executions trades from the indicator.


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Taddypole with 10 posts (1 thanks)
    2. looks_two shodson with 5 posts (1 thanks)
    3. looks_3 aquarius with 2 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
      Best Posters
    1. looks_one gregid with 1 thanks per post
    2. looks_two aquarius with 0.5 thanks per post
    3. looks_3 shodson with 0.2 thanks per post
    4. looks_4 Taddypole with 0.1 thanks per post
    1. trending_up 5,981 views
    2. thumb_up 4 thanks given
    3. group 7 followers
    1. forum 21 posts
    2. attach_file 9 attachments




 
Search this Thread

Get executions trades from the indicator.

  #11 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
Quantoholic
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,976 since Jun 2009
Thanks Given: 533
Thanks Received: 3,709

put a "var" in front of the "account = " on line 3463. you have to declare that account is a variable before you start trying to use it. that should make the other problems go away

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Deepmoney LLM
Elite Quantitative GenAI/LLM
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
Build trailing stop for micro index(s)
Psychology and Money Management
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
43 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #12 (permalink)
 Taddypole 
Phoenix, Arizona
 
Experience: Advanced
Platform: Ninja Trader
Trading: Oil
Posts: 54 since Jul 2009
Thanks Given: 1
Thanks Received: 7

Thanks Shodson,

but I still get a few compile errors. See attachment.

thank you,
taddypole...

Attached Thumbnails
Click image for larger version

Name:	complieErrors2.jpg
Views:	172
Size:	167.5 KB
ID:	185506  
Reply With Quote
  #13 (permalink)
 Taddypole 
Phoenix, Arizona
 
Experience: Advanced
Platform: Ninja Trader
Trading: Oil
Posts: 54 since Jul 2009
Thanks Given: 1
Thanks Received: 7


Added the EventHandlers.. I think that's what they are...and cleared up the previous compile errors. But now one of the EventHandlers seems to have a syntax problem. See attached....

regards,
taddypole...

Attached Thumbnails
Click image for larger version

Name:	complieErrors3.jpg
Views:	167
Size:	332.5 KB
ID:	185548  
Reply With Quote
  #14 (permalink)
 
aquarius's Avatar
 aquarius 
Monterrey, Mexico
 
Experience: Beginner
Platform: NinjaTrader
Trading: Treasuries
Posts: 22 since Nov 2012
Thanks Given: 5
Thanks Received: 69


Taddypole View Post
Added the EventHandlers.. I think that's what they are...and cleared up the previous compile errors. But now one of the EventHandlers seems to have a syntax problem. See attached....

regards,
taddypole...

You can quick-try commenting out lines 5826 and 5832 (from your attached image..) or just simply remove the Print statements there...

Reply With Quote
  #15 (permalink)
 Taddypole 
Phoenix, Arizona
 
Experience: Advanced
Platform: Ninja Trader
Trading: Oil
Posts: 54 since Jul 2009
Thanks Given: 1
Thanks Received: 7

Ok... kind of got all that working enough to find out the "MarketPosition" is not the parameter that I want. It does something strange. When I enter long... MarketPosition is "Long". that's good. But when I close that position, MarketPosition says "Short". And when I'm flat, there are no more MarketPosition updates using PositionUpdate.

So I'm back to looking at Executions and focusing on "Position" in the most recent Execution update. The Positiion parameter is numerical and represents a negative or positive number for short or long and zero if flat. But I need to select the most recent execution from the collection and still not sure how to do that.

I've been looking at LinQ methods but no idea which syntax to use.

regards,
taddypole...

Attached Thumbnails
Click image for larger version

Name:	ExecutionPositionInformation.jpg
Views:	191
Size:	813.4 KB
ID:	185557   Click image for larger version

Name:	CodeForPosition.jpg
Views:	168
Size:	102.7 KB
ID:	185558  
Reply With Quote
  #16 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
Quantoholic
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,976 since Jun 2009
Thanks Given: 533
Thanks Received: 3,709


Taddypole View Post
Thanks Shodson,

but I still get a few compile errors. See attachment.

thank you,
taddypole...

It's too hard to help you because you're too inexperienced with programming. You should learn C# and some object-oriented programming before trying to get good at Ninjascript.

C# Fundamentals for Absolute Beginners

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #17 (permalink)
 
shuglu's Avatar
 shuglu 
Melbourne
 
Experience: None
Platform: NinjaTrader
Broker: Amp/CQG
Trading: NQ
Posts: 71 since Jul 2012
Thanks Given: 312
Thanks Received: 94


Reply With Quote
  #18 (permalink)
 Taddypole 
Phoenix, Arizona
 
Experience: Advanced
Platform: Ninja Trader
Trading: Oil
Posts: 54 since Jul 2009
Thanks Given: 1
Thanks Received: 7


shodson View Post
It's too hard to help you because you're too inexperienced with programming. You should learn C# and some object-oriented programming before trying to get good at Ninjascript.

C# Fundamentals for Absolute Beginners

I really appreciate your help Shodson, but just to let you know, I'm not a complete beginner. I've been learning C# since I first started working with NinjaTrader 3 years ago. I've learned a lot, but being in an unsupported area of NinjaScript makes this part more difficult. Ive done a few things with collections before but they are not second nature to me. I just need bread crumbs to keep my going the the right direction.

regards,
taddypole...

Reply With Quote
  #19 (permalink)
 Taddypole 
Phoenix, Arizona
 
Experience: Advanced
Platform: Ninja Trader
Trading: Oil
Posts: 54 since Jul 2009
Thanks Given: 1
Thanks Received: 7


shuglu View Post

ShuGlu,

Thanks for the great reference. That will help a lot.

regards,
taddypole...

Reply With Quote
  #20 (permalink)
 Taddypole 
Phoenix, Arizona
 
Experience: Advanced
Platform: Ninja Trader
Trading: Oil
Posts: 54 since Jul 2009
Thanks Given: 1
Thanks Received: 7


Last night I was looking at the trace file and found what I think will work. I was troubled because "ExecutionUpdateEventArgs" didn't have what I was looking for. But in the trace file I found there was another ExecutionUpdateEventArgs which is ExecutionUpdateEventArgs2. Refer to the attachment. It has the "Position" parameter that I want. Triggering on that even I will get the latest position information for the instrument I'm interested in.

I tried to add the code but during the compile I get an error. Does anyone know how to get "ExecutionUpdateEventArgs2" ?

regards,
taddypole...

Attached Thumbnails
Click image for larger version

Name:	ExecutionUpdateEventArgs2.jpg
Views:	185
Size:	333.8 KB
ID:	185613   Click image for larger version

Name:	TraceWithExecutionUpdateEventArgs2.jpg
Views:	162
Size:	137.8 KB
ID:	185614  
Reply With Quote




Last Updated on July 23, 2015


© 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