EnterShort() out of an indicator - futures io
futures io futures trading



EnterShort() out of an indicator


Discussion in NinjaTrader

Updated
    1. trending_up 1,079 views
    2. thumb_up 4 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

(If you already have an account, login at the top of the page)

 
Search this Thread
 

EnterShort() out of an indicator

(login for full post details)
  #1 (permalink)
Bremen
 
 
Posts: 3 since Dec 2014
Thanks: 5 given, 0 received

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

Can you help answer these questions
from other members on futures io?
MACD line not plotting after change of plot order
NinjaTrader
Reading A set of Trading Signals
EasyLanguage Programming
Help Needed: TOS Options Chain IV & IMPL MOVE Calcul …
ThinkOrSwim
Second Entry Indicator (Looking for testers/feedback)
NinjaTrader
Automatic pattern research with NT
Elite Algorithmic NinjaTrader Trading
 
 
(login for full post details)
  #2 (permalink)
OC, California, USA
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,958 since Jun 2009
Thanks: 528 given, 3,648 received

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

Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to shodson for this post:
 
(login for full post details)
  #3 (permalink)
Bremen
 
 
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
	}
}

Reply With Quote
 
(login for full post details)
  #4 (permalink)
OC, California, USA
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,958 since Jun 2009
Thanks: 528 given, 3,648 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

Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to shodson for this post:
 
(login for full post details)
  #5 (permalink)
Perth + WA/Australia, Sydney and Manila
 
Experience: Advanced
Platform: NinjaTrader Optionvue
Broker: NinjaTrader Continuum and Kinetick
Trading: ES, CL, GC
 
Posts: 57 since Jun 2013
Thanks: 1 given, 25 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:
 
(login for full post details)
  #6 (permalink)
Bremen
 
 
Posts: 3 since Dec 2014
Thanks: 5 given, 0 received

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

Thanks for reply to my thread !

Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > EnterShort() out of an indicator


Last Updated on December 30, 2014


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



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