Exit Signal Help - NinjaTrader Programming | futures io social day trading
futures io futures trading


Exit Signal Help
Updated: Views / Replies:790 / 3
Created: by jordis 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
 

Exit Signal Help

  #1 (permalink)
Elite Member
Mobile, Alabama
 
Futures Experience: Beginner
Platform: NinjaTrader, TOS
Favorite Futures: Stocks
 
Posts: 29 since Sep 2011
Thanks: 6 given, 4 received

Exit Signal Help

Hopefully this is a simple task that I am just too stupid to grasp at the moment, but here goes:

If I want to trade based on an indicator (just say a moving average or something), and I want to buy at some point below the average. However, I want to wait until the price moves above the average, and at this time I would like to set this same average to be my exit condition to the downside.

So, train of thought would be:

1. Go long at Point A below moving average
2. Wait until Close[0] is above the moving average
3. Exit Long when Close[0] crosses back below the moving average



I tried coding it sort of like this, but it doesn't work at all.

 
Code
if (Positions[0].MarketPosition == MarketPosition.Long)
				{
					 if (Close[0] > MovingAverage)
						if(CrossBelow(EMA(1), MovingAverage), 1))
						{
							ExitLong("c"+Time[-1], "long");
						}
						
				}

Can anyone provide some help on this? I know it's convoluted, but I'd at least like to learn how to code this (for educational purposes if nothing else!)

Thanks,
Jordis

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Northern Germany
 
Futures Experience: Intermediate
Platform: NT
Favorite Futures: FDAX, CL
 
vvhg's Avatar
 
Posts: 1,583 since Mar 2011
Thanks: 1,016 given, 2,807 received



jordis View Post
Hopefully this is a simple task that I am just too stupid to grasp at the moment, but here goes:

If I want to trade based on an indicator (just say a moving average or something), and I want to buy at some point below the average. However, I want to wait until the price moves above the average, and at this time I would like to set this same average to be my exit condition to the downside.

So, train of thought would be:

1. Go long at Point A below moving average
2. Wait until Close[0] is above the moving average
3. Exit Long when Close[0] crosses back below the moving average



I tried coding it sort of like this, but it doesn't work at all.

 
Code
if (Positions[0].MarketPosition == MarketPosition.Long)
				{
					 if (Close[0] > MovingAverage)
						if(CrossBelow(EMA(1), MovingAverage), 1))
						{
							ExitLong("c"+Time[-1], "long");
						}
						
				}

Can anyone provide some help on this? I know it's convoluted, but I'd at least like to learn how to code this (for educational purposes if nothing else!)

Thanks,
Jordis

I assume you have CalculateOnBarClose=true;

The easiest way would be to use a simple bool flag like
 
Code
if(crossedabove && CrossBelow(Close[0], MovingAverage) 
{
ExitLong();
crossedabove = false;
}
else if(Crossabove(Close[0], MovingAverage) && Positions[0].MarketPosition != MarketPosition.Flat) crossedabove = true;
Vvhg

Hic Rhodos, hic salta.
Reply With Quote
 
  #4 (permalink)
Elite Member
Lubbock TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Stage 5 Trading
Favorite Futures: CL
 
MWinfrey's Avatar
 
Posts: 1,879 since Jul 2009
Thanks: 1,449 given, 3,306 received


jordis View Post
Hopefully this is a simple task that I am just too stupid to grasp at the moment, but here goes:

If I want to trade based on an indicator (just say a moving average or something), and I want to buy at some point below the average. However, I want to wait until the price moves above the average, and at this time I would like to set this same average to be my exit condition to the downside.

So, train of thought would be:

1. Go long at Point A below moving average
2. Wait until Close[0] is above the moving average
3. Exit Long when Close[0] crosses back below the moving average



I tried coding it sort of like this, but it doesn't work at all.

 
Code
if (Positions[0].MarketPosition == MarketPosition.Long)
				{
					 if (Close[0] > MovingAverage)
						if(CrossBelow(EMA(1), MovingAverage), 1))
						{
							ExitLong("c"+Time[-1], "long");
						}
						
				}

Can anyone provide some help on this? I know it's convoluted, but I'd at least like to learn how to code this (for educational purposes if nothing else!)

Thanks,
Jordis

How about something like this...I hope I interpreted your rule correctly.


if (Close[0] < MovingAverage[0]) EnterLong();


if (Close[0] < MovingAverage[0] && High[0] >= MovingAverage[0]) ExitLong();

Reply With Quote

Reply



futures io > > > > > Exit Signal Help

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
From an indicator to trading signal: arjfca EasyLanguage Programming 6 May 9th, 2016 04:21 AM
Signal service freddy250 Trading Reviews and Vendors 2 December 18th, 2012 07:11 PM
Q on signal counting in MC aczk EasyLanguage Programming 6 February 14th, 2012 11:35 AM
HOD/LOD Signal DennisA Elite Automated Trading 4 March 14th, 2011 10:29 AM
BEST BEST Entry Signal dimitri The Elite Circle 11 January 28th, 2011 07:47 AM


All times are GMT -4. The time now is 01:58 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 54.226.34.209