EnterShort() out of an indicator - NinjaTrader | futures io social day trading
futures io futures trading


EnterShort() out of an indicator
Updated: Views / Replies:627 / 5
Created: by excess 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
 

EnterShort() out of an indicator

  #1 (permalink)
Trading Apprentice
Bremen
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: CL
 
Posts: 3 since Dec 2014
Thanks: 5 given, 0 received

EnterShort() out of an indicator

Hello traders,

i am a new user of ninjaTrader and i am writing my own little indicator.
Now i want to automate it an try to make calls to EnterShort() or EnterLong() ...

but sadly i get the compile error : CS0103


the call from an strategy is possible

thanks and greetings

Reply With Quote
 
  #2 (permalink)
 Vendor: www.probabletrades.com 
OC, California, USA
 
Futures Experience: Advanced
Platform: IB/TWS, NinjaTrader, thinkorswim
Favorite Futures: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,859 since Jun 2009
Thanks: 480 given, 3,254 received

Only strategies can place orders. Indicators cannot place orders. You need to write a strategy.

Reply With Quote
The following user says Thank You to shodson for this post:
 
  #3 (permalink)
Trading Apprentice
Bremen
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: CL
 
Posts: 3 since Dec 2014
Thanks: 5 given, 0 received


thank u for the answer.
have nice Christmastime !

i have tryed to port the indicator to an strategy, but without the full succes

i have written now a Strategy, like you recommended to me

now i need one value (of the member UpTrend ) of the indicator TSSuperTrend in my stategy.
but i do not know how to reference that one. the try to reference it like i successfull do with the SMA does not work

i hope somebody understand my problem despite my bad english

 
Code
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
	/// <summary>
	/// Enter the description of your strategy here
	/// </summary>
	[Description("Enter the description of your strategy here")]
	public class MyStrategy : Strategy
	{
		#region Variables
			private DataSeries		diff;
		#endregion

		/// <summary>
		/// This method is used to configure the strategy and is called once before any strategy method is called.
		/// </summary>
		protected override void Initialize()
		{
			diff				= new DataSeries(this);
			CalculateOnBarClose = false;
			ClearOutputWindow();
		}

		/// <summary>
		/// Called on each bar update event (incoming tick)
		/// </summary>
		protected override void OnBarUpdate()
		{
			if(CurrentBar < 30){
				return;
			}

			double FA = SMA(Close, 3)[0];
			double SA = SMA(Close, 10)[0];

			double val = (FA - SA) / TickSize;

			diff.Set(val);

			if (Rising(diff)){
				Print(Time[0] + "  #  upTrend   #  " +  Math.Round(val));
			}
			else{
				Print(Time[0] + "  #  downTrend    #  " +  Math.Round(val));
			}

			// the folowing line Print(...) produces compiler error : NinjaTrader.Strategy.Strategy.TSSuperTrend(int, TSSuperTrend.Utility.MovingAverageType, double, int, TSSuperTrend.Utility.SuperTrendMode)' is a 'method', which is not valid in the given context

			Print(TSSuperTrend(14, TSSuperTrend.Utility.MovingAverageType.SMA, 2.618, 14, TSSuperTrend.Utility.SuperTrendMode.ATR).UpTrend[0]);
		}

		#region Properties
		#endregion
	}
}


Last edited by excess; December 25th, 2014 at 09:30 PM. Reason: format code well
Reply With Quote
 
  #4 (permalink)
 Vendor: www.probabletrades.com 
OC, California, USA
 
Futures Experience: Advanced
Platform: IB/TWS, NinjaTrader, thinkorswim
Favorite Futures: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,859 since Jun 2009
Thanks: 480 given, 3,254 received

After downloading and installing this version of TSSuperTrend, this code compiles fine

 
Code
Print(TSSuperTrendV2_4(14, TSSuperTrend.Utility.MovingAverageType.SMA, 2.618, 14, TSSuperTrend.Utility.SuperTrendMode.ATR).UpTrend[0]);
I'm not sure which one you are using

Reply With Quote
The following user says Thank You to shodson for this post:
 
  #5 (permalink)
Elite Member
Perth + WA/Australia, Sydney and Manila
 
Futures Experience: Intermediate
Platform: NinjaTrader and Optionvue 7
Broker/Data: NinjaTrader Continuum and Kinetick
Favorite Futures: Emini
 
Posts: 43 since Jun 2013
Thanks: 1 given, 16 received

This is probably not what you want to hear, but I would concern myself more with market structure than indicators.

Reply With Quote
The following 2 users say Thank You to AnyM for this post:
 
  #6 (permalink)
Trading Apprentice
Bremen
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: CL
 
Posts: 3 since Dec 2014
Thanks: 5 given, 0 received

solved :)

i have written a strategy now and works fine for me.

Thanks for reply to my thread !

Reply With Quote

Reply



futures io > > > > EnterShort() out of an indicator

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
Opening Range Indicator (w/ Indicator Input) wuileng NinjaTrader 5 January 21st, 2014 07:52 AM
How to call this indicator within the indicator/strategy zikonc NinjaTrader 2 July 26th, 2012 04:45 PM
Indicator Based Upon Other Indicator Colors ScorpioTravis NinjaTrader Programming 12 June 21st, 2012 07:29 PM
Adding Constant Line Indicator to Another Indicator ceramictilepro NinjaTrader Programming 9 September 22nd, 2011 11:43 PM


All times are GMT -4. The time now is 08:47 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-10 in 0.10 seconds with 19 queries on phoenix via your IP 54.83.122.227