Stop strategy after a set $ amount lost from CumProfit - NinjaTrader Programming | futures io social day trading
futures io futures trading

Stop strategy after a set $ amount lost from CumProfit
Updated: Views / Replies:5,752 / 21
Created: by vast 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 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

Thread Tools Search this Thread

Stop strategy after a set $ amount lost from CumProfit

  #21 (permalink)
Elite Member
Futures Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 798 since Jun 2009
Thanks: 109 given, 786 received

If your broker supports it and if you run more than 1 strategy, you might consider a stand-alone strategy that uses the GetAccountValue() method. You would need to manually enter your account value at the start of session as that method only works in OnBarDate.

You could then code a daily loss limit for that account, and a "trailing stop" on your equity curve that could trigger an alert or the FlattenEverything() command.

Just be careful if you invoke FlattenEverything() at the same time you are closing positions with other trade logic as you could get inflight issues. A way around it is to apply this stratgey to a different time series than the one you are trading on (say 3 minute bars, COBC=true, for example).

Happy coding!

Reply With Quote
The following user says Thank You to MXASJ for this post:
  #22 (permalink)
Elite Member
Futures Experience: Intermediate
Platform: Ninja
vast's Avatar
Posts: 167 since Jun 2009
Thanks: 154 given, 59 received

Hi Jon

Well I did play with the idea for a bit, but gave up after I realised that I could never get a strategy to do what I wanted.
the money management side was ok, but I couldn't get an strategy that I was happy with. So I gave up, and went back to trading manually. This was the main part of the code.
I am a very basic programmer, and tend to use code from other users, then change it a bit.

Prevents further trading if the current session's realized profit exceeds $myMaxProfit or if realized losses exceed $myMaxLoss.
            not working:(Also prevent trading if 10 trades have already been made in this session.) */
            if (//Performance.AllTrades.TradesPerformance.Currency.CumProfit - priorTradesCumProfit >= myMaxProfit
                                        Math.Round(Position.GetProfitLoss(Close[0], PerformanceUnit.Currency))) - priorTradesCumProfit >= myMaxProfit
                || Performance.AllTrades.TradesPerformance.Currency.CumProfit - priorTradesCumProfit <= myMaxLoss  
                || maxConsecLoser >= myMaxConsecLoss
                || cumProfit <= maxCumProfit - maxRiskProfit

Reply With Quote
The following user says Thank You to vast for this post:


futures io > > > > > Stop strategy after a set $ amount lost from CumProfit

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using SuperTrend for trailing stop in a strategy - help needed DarrenH NinjaTrader Programming 16 September 29th, 2017 10:03 PM
Volume stop Strategy Possible ? isarhodes NinjaTrader Programming 5 July 12th, 2011 04:02 PM
How to set up a Stop (Limit) Loss order - Ninja Trader jdumanic NinjaTrader 2 June 7th, 2011 05:40 PM
MOVE STOP LOSS AFTER STRATEGY firecan NinjaTrader Programming 2 December 13th, 2010 05:54 AM
Drawdowns, when has a strategy lost its 'edge' fluxsmith Psychology and Money Management 6 October 16th, 2010 06:24 PM

All times are GMT -4. The time now is 01:32 AM.

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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-05-28 in 0.07 seconds with 19 queries on phoenix via your IP