Anyone who needs a flat stop set after a certain amount of profit, I have an answer - NinjaTrader | futures io social day trading
futures io futures trading

Anyone who needs a flat stop set after a certain amount of profit, I have an answer
Updated: Views / Replies:512 / 0
Created: by sra18376 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

Anyone who needs a flat stop set after a certain amount of profit, I have an answer

  #1 (permalink)
kansas city, ks
Posts: 17 since Jun 2014
Thanks: 0 given, 5 received

Anyone who needs a flat stop set after a certain amount of profit, I have an answer

I have gone from being completely new to ninjatrader, ninjascript and programming in general to finishing programming my own strategy in about a month and a half, and I have to give a lot of credit to this forum, because browsing through threads here taught me 80% of what I learned.

So to pay it forward here is a little code that I have seen a lot of people have questions about. Setting a flat stop once you are a few points in profit. The great thing about this code is that you can still use SetTrailStop() if you want because this code doesn't use SetStopLoss(). So here it is. Enjoy

This will set a flat stop once you are 2 points in profit.

Under the Variables region:

private bool stopSet = false;

Under the OnBarUpdate() section:

if (Position.MarketPosition == MarketPosition.Long)
				if (Close [0] >= Position.AvgPrice + 2)
				stopSet = true;

				if (stopSet && Close [0] <= Position.AvgPrice)
				stopSet = false;

Reply With Quote
The following 2 users say Thank You to sra18376 for this post:


futures io > > > > Anyone who needs a flat stop set after a certain amount of profit, I have an answer

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now

Show us your trading desks and win over $5,000 in prizes w/Jigsaw Trading


Webinar: The Best Entries and Exits in trading & in life w/Agustin Lebron

Elite only

Webinar: NinjaTrader 8 Newest Features Release Sneak Peek

Sep 26

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up a daily stop loss? sunsun MultiCharts 7 December 13th, 2015 08:56 AM
Set Stop loss gerimo NinjaTrader Programming 3 May 24th, 2012 01:36 PM
Samsung Elec. Quarterly Profit Falls on Chips, Flat Screens Quick Summary News and Current Events 0 January 27th, 2011 08:20 PM
Set Profit and Loss Variables brightredmegaphone NinjaTrader Programming 20 December 10th, 2010 06:21 PM
Stop strategy after a set $ amount lost from CumProfit vast NinjaTrader Programming 21 November 15th, 2010 04:24 PM

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

Copyright © 2019 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