Flatten all trades NT8 help - NinjaTrader Programming | futures io social day trading
futures io futures trading

Flatten all trades NT8 help
Updated: Views / Replies:578 / 1
Created: by ElBi Attachments:0

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 100,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

Thread Tools Search this Thread

Flatten all trades NT8 help

  #1 (permalink)
Elite Member
North Bergen
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Cl, ZB
Posts: 4 since Feb 2017
Thanks: 2 given, 0 received

Flatten all trades NT8 help

Good afternoon all.

I looked around and am trying to set a strategy that oversees the account and closes out and disables all the strategies I have on my account when I reach a 1000 profit target or a 870 loss.

does not work on NT8.

Here is my code:

myAccount = Account.All.FirstOrDefault(a => a.Name == "Sim101");

if (myAccount.Get(AccountItem.UnrealizedProfitLoss, Currency.UsDollar) >= 1000 )
	Print("1000 hit PnL: " + myAccount.Get(AccountItem.UnrealizedProfitLoss, Currency.UsDollar) + " " + Times[0][0].TimeOfDay);

if (myAccount.Get(AccountItem.UnrealizedProfitLoss, Currency.UsDollar) <= -870)

	Print("-870 hit PnL: " + myAccount.Get(AccountItem.UnrealizedProfitLoss, Currency.UsDollar)+ " @ " + Times[0][0].TimeOfDay);

if ((Times[0][0].DayOfWeek == DayOfWeek.Friday) && (Times[0][0].TimeOfDay >= new TimeSpan(16, 40, 0)))

As soon as I enable this, it disables all the strategies. Is there something I missed in the "If" statements?

Thank you!!


Turnes out that if you use
it goes thru all the bars on the chart and sure enough, there were two Friday 16:40 bars on the chart.


and it will only check future bars.

Thanks for your time!! Hope someone will learn from my blunders!

Last edited by ElBi; May 1st, 2017 at 08:49 PM. Reason: added myAccount info - Solved
Reply With Quote
  #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.


futures io > > > > > Flatten all trades NT8 help

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

September Journal Challenge (sponsored by TopstepTrader)


Free Elite Membership: Twitter Tuesday and Facebook Friday!

Tue & Fri

Trading with Python: Using Machine Learning w/Ran Aroussi [12:30PM ET]

Elite only

TopstepTrader (TBD)

Sep 25

RandBots (TBD)

Sep 27

Anthony Drager (TBD)

Oct 4

Similar Threads
Thread Thread Starter Forum Replies Last Post
Who has switched to NT8? Who still trades on NT7? BarefootHank2017 NinjaTrader 32 May 22nd, 2018 01:28 AM
Good trades, bad trades, winning trades & losing trades AsymOlly Trading Journals 42 July 11th, 2016 10:08 AM
Flatten Strategy? SirPsycho ThinkOrSwim 4 January 11th, 2013 07:48 PM
Flatten All Positions togier NinjaTrader Programming 11 October 13th, 2012 01:55 AM
Flatten All ? phyzfer NinjaTrader Programming 12 April 30th, 2011 11:37 AM

All times are GMT -4. The time now is 04:19 PM. (this page content is cached, log in for real-time version)

Copyright © 2018 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 2018-09-18 in 0.10 seconds with 14 queries on phoenix