SuperTrendU11 Strategy Query - NinjaTrader Programming | futures io social day trading
futures io futures trading


SuperTrendU11 Strategy Query
Updated: Views / Replies:1,872 / 14
Created: by sburtt Attachments:3

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
 3  
 
Thread Tools Search this Thread
 

SuperTrendU11 Strategy Query

  #11 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,571 given, 3,982 received


sburtt View Post
sam028, thanks. whereabouts in the code should I include this script? and what exactly would this help doing? I am just asking because I would like to learn

thanks

You can add this in OnPositionUpdate() or in OnBarUpdate(), that will show you of the value you try to use in your stoploss() function.

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #12 (permalink)
Elite Member
London, UK
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: EUR/USD
 
Posts: 58 since Jul 2012
Thanks: 3 given, 4 received


sam028 View Post
You can add this in OnPositionUpdate() or in OnBarUpdate(), that will show you of the value you try to use in your stoploss() function.

the issue still persists. I am happy to share the code if somebody is willing to look into this. The issue is the StopLine or StopDot plotted by the SuperTrendU11 indicator, I want to use this a hard stoploss but I continue to encounter charts like this in
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
 
  #13 (permalink)
Elite Member
Zurich, Switzerland
 
Futures Experience: None
Platform: NT
Favorite Futures: Ukulele
 
Posts: 16 since Mar 2011
Thanks: 342 given, 14 received


you have to take care that SetStopLoss is updated before your strategy enters a new position otherwise you will be immediately taken out by your former Long Stop Loss (in case you enter short).

from the NT 7 help (NinjaTrader Version 7 )
• You may call this method from within the strategy OnBarUpdate() method should you wish to dynamically change the stop loss price while in an open position
• Should you call this method to dynamically change the stop loss price in the strategy OnBarUpdate() method, you should always reset the stop loss price/offset value when your strategy is flat otherwise, the last price/offset value set will be used to generate your stop loss order on your next open position

Reply With Quote
The following user says Thank You to askerix for this post:
 
  #14 (permalink)
Elite Member
London, UK
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: EUR/USD
 
Posts: 58 since Jul 2012
Thanks: 3 given, 4 received


askerix View Post
you have to take care that SetStopLoss is updated before your strategy enters a new position otherwise you will be immediately taken out by your former Long Stop Loss (in case you enter short).

from the NT 7 help (NinjaTrader Version 7 )
• You may call this method from within the strategy OnBarUpdate() method should you wish to dynamically change the stop loss price while in an open position
• Should you call this method to dynamically change the stop loss price in the strategy OnBarUpdate() method, you should always reset the stop loss price/offset value when your strategy is flat otherwise, the last price/offset value set will be used to generate your stop loss order on your next open position

that made the trick, thanks it's working fine now.

Reply With Quote
 
  #15 (permalink)
Elite Member
London, UK
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: EUR/USD
 
Posts: 58 since Jul 2012
Thanks: 3 given, 4 received


askerix View Post
you have to take care that SetStopLoss is updated before your strategy enters a new position otherwise you will be immediately taken out by your former Long Stop Loss (in case you enter short).

from the NT 7 help (NinjaTrader Version 7 )
• You may call this method from within the strategy OnBarUpdate() method should you wish to dynamically change the stop loss price while in an open position
• Should you call this method to dynamically change the stop loss price in the strategy OnBarUpdate() method, you should always reset the stop loss price/offset value when your strategy is flat otherwise, the last price/offset value set will be used to generate your stop loss order on your next open position

by any chance, would you know if it's possible to optimize the AnaSuperTrendU11 parameters used in a strategy via the StrategyAnalyzer optimizer? When I try to optimize I receive the following error message:

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


I am running a very simple code, not sure what'screating this issue, code below. Thanks

 
Code
namespace NinjaTrader.Strategy
{
    [Description("")]
    public class aaaFisherAnaSuperTrendLong : Strategy
    {
        #region Variables
		private int period = 10;
		private int multiplier = 3;
		private int rngPeriod = 6;

        #endregion

        protected override void Initialize()
        {
			Add(anaSuperTrendU11(period, multiplier, rngPeriod, false, anaSuperTrendU11BaseType.TEMA, anaSuperTrendU11OffsetType.Default, anaSuperTrendU11VolaType.Standard_Deviation));
            CalculateOnBarClose = true;
			EntryHandling 	=	EntryHandling.UniqueEntries;
			ExitOnClose = false;
		}
        
        protected override void OnBarUpdate()
        {							
			if (Position.MarketPosition == MarketPosition.Flat)
				SetStopLoss(CalculationMode.Ticks,100);
				
			//Enter long
			if (CrossAbove(..))
				EnterLong("Long");
			
			if (Position.MarketPosition == MarketPosition.Long)
				SetStopLoss(CalculationMode.Price,Instrument.MasterInstrument.Round2TickSize(anaSuperTrendU11(period, multiplier, rngPeriod, false, anaSuperTrendU11BaseType.TEMA, anaSuperTrendU11OffsetType.Default, anaSuperTrendU11VolaType.Standard_Deviation).StopDot[0]));
			
        }

        #region Properties		
		[Description("")]
        [GridCategory("Parameters")]
        public int Period
        {
            get { return period; }
            set { period = Math.Max(0, value); }
        }
		
		[Description("")]
        [GridCategory("Parameters")]
        public int Multiplier
        {
            get { return multiplier; }
            set { multiplier = Math.Max(0, value); }
        }		
		
		[Description("")]
        [GridCategory("Parameters")]
        public int RngPeriod
        {
            get { return rngPeriod; }
            set { rngPeriod = Math.Max(0, value); }
        }		
 		#endregion
    }
}

Reply With Quote

Reply



futures io > > > > > SuperTrendU11 Strategy Query

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
SuperTrendU11 backtesting GaryD NinjaTrader Programming 8 December 8th, 2014 05:25 PM
Three Line Break on FX Query Zhorny MultiCharts 1 November 21st, 2012 06:12 AM
Direct query for account balance? drmartell Reviews of Brokers and Data Feeds 4 November 15th, 2012 02:01 PM
Using Excel to query MySQL database Big Mike The Elite Circle 3 November 7th, 2012 08:40 AM
Database - A Simple Query ab456 Traders Hideout 1 October 15th, 2011 03:04 PM


All times are GMT -4. The time now is 05:11 PM.

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 20 queries on phoenix via your IP 54.226.132.197