Setting a Stop Loss to Activate before Interval Close - NinjaTrader Programming | futures io social day trading
futures io futures trading


Setting a Stop Loss to Activate before Interval Close
Updated: Views / Replies:650 / 11
Created: by stealthtrading 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

Reply
 
Thread Tools Search this Thread
 

Setting a Stop Loss to Activate before Interval Close

  #11 (permalink)
Elite Member
Omer עומר / Israel י
 
Futures Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,475 since Sep 2013
Thanks: 1,696 given, 3,670 received
Forum Reputation: Legendary


stealthtrading View Post
I understand what you're saying and appreciate your explaining the 2 orders (Profit/Stop), but if this is the case I misunderstood the function of the stop. I was under the impression that I could have multiple conditions for exit that could still occur if their criteria was met prior to the Stop(s).

Since this isn't the case, my problem unfortunately remains. I'm running 10 minute intervals, and have a condition that leads to an exit if a loss exceeding -0.04 occurs (if (Position.GetProfitLoss(OnMarketUpdate[0], PerformanceUnit.Percent) < -0.04). This is current a part of OnBarUpdate (which I realize means that it'll only look at the end of each interval).

I need this exit to occur at any time a loss of -4% is reached, instead of only checking at the end of each bar. if I can achievethis by using OnMarketBar or OnMarketUpdate, I'm not sure how to program/code or where to place it. I'm completely ok with it using the 'Last', 'Bid' or 'Ask' to constantly check to see if the Unrealized P/L of -0.04% has been reached.

If you look at the example i have give, that is doing all of this
1. put fixed target/stop at the order (the stop sits on the broker and not your pc
2. update the target/stop based on conditions

Reply With Quote
 
  #12 (permalink)
Elite Member
Omer עומר / Israel י
 
Futures Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,475 since Sep 2013
Thanks: 1,696 given, 3,670 received
Forum Reputation: Legendary


stealthtrading View Post
I understand what you're saying and appreciate your explaining the 2 orders (Profit/Stop), but if this is the case I misunderstood the function of the stop. I was under the impression that I could have multiple conditions for exit that could still occur if their criteria was met prior to the Stop(s).

Since this isn't the case, my problem unfortunately remains. I'm running 10 minute intervals, and have a condition that leads to an exit if a loss exceeding -0.04 occurs (if (Position.GetProfitLoss(OnMarketUpdate[0], PerformanceUnit.Percent) < -0.04). This is current a part of OnBarUpdate (which I realize means that it'll only look at the end of each interval).

I need this exit to occur at any time a loss of -4% is reached, instead of only checking at the end of each bar. if I can achievethis by using OnMarketBar or OnMarketUpdate, I'm not sure how to program/code or where to place it. I'm completely ok with it using the 'Last', 'Bid' or 'Ask' to constantly check to see if the Unrealized P/L of -0.04% has been reached.

In OnMarketUpdate, you would do that very much the same as in any other event.
You just use the event for the logic of your code to be execute, you make your test, if the outcome is such that you need to exit, you do so. In my example, you will find the same thing :

(simplified copy of the code : )

 
Code
protected override void OnMarketData (MarketDataEventArgs e)
		{
                    if ("put here your condition")
			    {			
					Print ("You can output something to the output window, it will help you understand the flow");
					ExitLong("Exit","Your Position");
				}
			
		}

Reply With Quote

Reply



futures io > > > > > Setting a Stop Loss to Activate before Interval Close

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
anasupertrend activate automatically stop curleta NinjaTrader Programming 4 December 16th, 2014 08:20 PM
Ninjascript -- Setting stop loss based on previous bars bstzgr The Elite Circle 6 August 25th, 2014 08:40 AM
Stop loss triggered at CLOSE of bar launch NinjaTrader Programming 2 August 1st, 2014 04:00 PM
Setting a Stop loss for all Position arjfca Elite EasyLanguage Automated Trading 3 November 28th, 2012 09:16 AM
Reading Interval setting in Strategy leduc NinjaTrader Programming 4 May 26th, 2010 07:48 PM


All times are GMT -4. The time now is 12:47 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-11 in 0.08 seconds with 19 queries on phoenix via your IP 107.20.115.174