making a Performance.SessionTrades (sort of) - NinjaTrader Programming | futures io social day trading
futures io futures trading


making a Performance.SessionTrades (sort of)
Updated: Views / Replies:1,124 / 4
Created: by LostTrader Attachments:2

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

making a Performance.SessionTrades (sort of)

  #1 (permalink)
Elite Member
Tucson, AZ
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL, TF
 
LostTrader's Avatar
 
Posts: 74 since Sep 2009
Thanks: 21 given, 62 received

making a Performance.SessionTrades (sort of)

I've asked NT for a TradeCollection of Performance.SessionTrades only but they don't have one.
So I am trying to finagle one up. I've gotten this far -- it works for me but I only ever trade one contract.

I've attached code which was extracted from my actual Strategy -- so don't think this code is a working Strategy!!! there are no entries. It merely provided a way to port the components needed.

Everything relevant is tied to the variable sessionTrades.
private TradeCollection sessionTrades;
I had to dummy up a constructor in OnStartUp(), and a reset function (same dummy code).
sessionTrades = Performance.RealtimeTrades.GetTrades(Instrument.MasterInstrument.Name, " ", 0);

I add the last trade to sessionTrades in OnPositionUpdate() when flat. I do not know if this is best, although it seems to work for 1 contract only.
sessionTrades.Add(Performance.AllTrades[Performance.AllTrades.Count - 1]); // adds a link, does not copy

At FirstBarOfSession, it prints statistics and resets the TradeCollection for the new session.

I am sharing as there are many programmers better than I and thought some-one could help improve it.
Like, how does it need to change for multiple contracts? legging in or out ?
Because when a single position has multiple trades, this will break down, I think.

Attached Thumbnails
making a Performance.SessionTrades (sort of)-nt-stc.png  
Attached Files
Register to download File Type: zip SessionTradeCollection.zip (4.3 KB, 12 views)
Reply With Quote
The following user says Thank You to LostTrader for this post:
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,218 received




Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #4 (permalink)
Elite Member
Tucson, AZ
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL, TF
 
LostTrader's Avatar
 
Posts: 74 since Sep 2009
Thanks: 21 given, 62 received

LOL. Thanks, Mike!

It's weird, NT Support says the TradeCollection is updated after OnPositionUpDate() which seems illogical to me, and the code I wrote looks during OnPositionUpDate() and finds that just closed trade. But they say it isn't reliable. Lovely.

So I made a formal request (#1095) for them to create the Performance.SessionTrades. We'll see how long it takes.

Reply With Quote
The following user says Thank You to LostTrader for this post:
 
  #5 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
 
Adamus's Avatar
 
Posts: 1,085 since Dec 2010
Thanks: 470 given, 778 received


LostTrader View Post
LOL. Thanks, Mike!

It's weird, NT Support says the TradeCollection is updated after OnPositionUpDate() which seems illogical to me, and the code I wrote looks during OnPositionUpDate() and finds that just closed trade. But they say it isn't reliable. Lovely.

So I made a formal request (#1095) for them to create the Performance.SessionTrades. We'll see how long it takes.

I hope NinjaTrader come up with the goods.

I am not surprised that the TradeCollection is updated after the OnPositionUpdate event. I recently read a thread on the NT support forum describing an issue related to this. They only put finished trades into the Performance trade collections, so it follows that this will only happen after an exit has caused the OnPositionUpdate event to fire.

Sorry that I can't help with the problem. I've come up against this kind of requirement before and in my experience, trying to solve it is a bit like trying to nail sh*t to a wall, if you'll excuse the expression. So I just live without it. And try not to let it get to me .

You can discover what your enemy fears most by observing the means he uses to frighten you.
Reply With Quote

Reply



futures io > > > > > making a Performance.SessionTrades (sort of)

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort of Market Profile indicator gomi NinjaTrader Programming 89 March 9th, 2012 07:48 PM
Markets Will Sort Through Credit Downgrade Quick Summary News and Current Events 0 August 6th, 2011 03:40 AM
Debt Talks Set to Resume—Sort of—At White House Quick Summary News and Current Events 0 July 20th, 2011 04:40 PM
Evaluating Performance Slipknot511 Psychology and Money Management 3 April 6th, 2011 12:37 PM
Account Performance alpine4133 NinjaTrader 2 September 12th, 2009 01:59 PM


All times are GMT -4. The time now is 02:41 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-12 in 0.10 seconds with 20 queries on phoenix via your IP 54.90.207.75