Manual entry, automated exit (Ninja Trader or other)? - NinjaTrader | futures io social day trading
futures io futures trading


Manual entry, automated exit (Ninja Trader or other)?
Updated: Views / Replies:7,204 / 34
Created: by peaceland Attachments:2

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

Manual entry, automated exit (Ninja Trader or other)?

  #21 (permalink)
Elite Member
Dartmouth NS
 
Futures Experience: Intermediate
Platform: MC, MC.Net, NT, TWS
Broker/Data: IB / IQFeed / Kids
Favorite Futures: Forex, stocks
 
bnichols's Avatar
 
Posts: 638 since Feb 2010
Thanks: 64 given, 459 received

Perhaps checking when no positions open. I believe a workaround may be

if(Position.MarketPosition == MarketPosition.Long)
[...]
which allows NT to handle the indices in any case.

Reply With Quote
 
  #22 (permalink)
Elite Member
Bala, PA, USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus, IB
Favorite Futures: SPY, Oil, Euro
 
monpere's Avatar
 
Posts: 1,858 since Jul 2010
Thanks: 300 given, 3,276 received


MWinfrey View Post
Ok...for me this is uncharted territory. I have the buttons working and attempting to add the code that will manage the trade. However, I'm having issues.

 
Code
if (NinjaTrader.Cbi.Globals.Accounts[0].Positions[0].MarketPosition == MarketPosition.Long)
... do something
However, I get an error saying "You are accessing an index with a value that is invalid since its out of range." Which doesn't surprise me. However, how do I set Accounts[0] and Positions[0] to something meaningful so I don't get that error? I had to swallow a bit of pride just to ask this question because I should be able to figure this out without asking. But, not getting anywhere.

Thanks,
Mike

I use this to check for open positions in Account[0] because I am generally connected to only one account, but if you generally are connected to multiple accounts, you would have to loop through the NinjaTrader.Cbi.Globals.Accounts[x] array as well.

 
Code
	//### Open Positions
if ( NinjaTrader.Cbi.Globals.Accounts.Count > 0 && NinjaTrader.Cbi.Globals.Accounts[0].Positions.Count > 0 ) {
	for (int i=0; i < NinjaTrader.Cbi.Globals.Accounts[0].Positions.Count; i++ ) {
		if ( NinjaTrader.Cbi.Globals.Accounts[0].Positions[i].Instrument.FullName == Instrument.FullName ) {
			Print(NinjaTrader.Cbi.Globals.Accounts[0].Name +" Position " +(i+1) +". "
			+NinjaTrader.Cbi.Globals.Accounts[0].Positions[i].Instrument.FullName +" "
			+NinjaTrader.Cbi.Globals.Accounts[0].Positions[i].MarketPosition +" "
			+NinjaTrader.Cbi.Globals.Accounts[0].Positions[i].Quantity +" "
			+"@"+NinjaTrader.Cbi.Globals.Accounts[0].Positions[i].AvgPrice+" "
			);
		}
	}
}

Reply With Quote
The following 2 users say Thank You to monpere for this post:
 
  #23 (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



monpere View Post
I use this to check for open positions in Account[0] because I am generally connected to only one account, but if you generally are connected to multiple accounts, you would have to loop through the NinjaTrader.Cbi.Globals.Accounts[x] array as well.

Thank you @monpere...that got me off top dead center.

Reply With Quote
 
  #24 (permalink)
Trading Apprentice
Lomita, CA/USA
 
Futures Experience: Intermediate
Platform: Ninja Trader
Favorite Futures: Forex
 
Posts: 8 since Sep 2012
Thanks: 0 given, 0 received


monpere View Post
There are all sorts of issues with MB Trading if your want to do anything innovative. Their systems and infrastructure are just antiquated. They have to shutdown after market everyday for maintenance, their responses to order executions and modifications are slow, they have regular unscheduled outages, the market will go through your orders by several ticks and you will not get fills. The only redeeming things I found were are that you can trade micro lots, and they pay you when you provide liquidity with limit orders. That's been my experience with them.

You can do most the things you want with various other brokers. I personally use Interactive Brokers and Mirus Futures to reliably do some of these things.

Don't have enough capital to open an IB account. What other FX brokers are reliable that I can work with? I looked for quite a while and MB seemed the best one for the $2k I have to start with.

Reply With Quote
 
  #25 (permalink)
Trading Apprentice
Lomita, CA/USA
 
Futures Experience: Intermediate
Platform: Ninja Trader
Favorite Futures: Forex
 
Posts: 8 since Sep 2012
Thanks: 0 given, 0 received

Since I am having so much trouble figuring out how to automate exits, what do you all think of Managed Forex Accounts? I know that you all prefer to do your own trading. I feel the same. But at this point, am not avail. to watch the account all night long...

What about doing something like this until I am able to resolve the issue?
Managed Forex Account | Forex Managed Accounts

Reply With Quote
 
  #26 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,218 received


peaceland View Post
Don't have enough capital to open an IB account. What other FX brokers are reliable that I can work with? I looked for quite a while and MB seemed the best one for the $2k I have to start with.

Please use the Brokers section of the forum for this question, not this thread which is for NinjaTrader "Manual entry, automated exit".

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #27 (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


monpere View Post
 
Code
	//### Open Positions
if ( NinjaTrader.Cbi.Globals.Accounts.Count > 0 && NinjaTrader.Cbi.Globals.Accounts[0].Positions.Count > 0 ) {
	for (int i=0; i < NinjaTrader.Cbi.Globals.Accounts[0].Positions.Count; i++ ) {
		if ( NinjaTrader.Cbi.Globals.Accounts[0].Positions[i].Instrument.FullName == Instrument.FullName ) {
			Print(NinjaTrader.Cbi.Globals.Accounts[0].Name +" Position " +(i+1) +". "
			+NinjaTrader.Cbi.Globals.Accounts[0].Positions[i].Instrument.FullName +" "
			+NinjaTrader.Cbi.Globals.Accounts[0].Positions[i].MarketPosition +" "
			+NinjaTrader.Cbi.Globals.Accounts[0].Positions[i].Quantity +" "
			+"@"+NinjaTrader.Cbi.Globals.Accounts[0].Positions[i].AvgPrice+" "
			);
		}
	}
}

@monpere using the construct you provided is very helpful. I added a condition to exit a trade and then added Strategy.ExitLong() if the exit condition is met. Unfortunately, I get an error "Object reference not set to an instance of an object." I loop through the accounts and positions arrays to get the right ones but yet I get that error. Have I given enough for you to know what might be happening?

Reply With Quote
 
  #28 (permalink)
Elite Member
California - USA/Rio grande do sul-Brasil.
 
Futures Experience: Intermediate
Platform: tradestation, ninja trader
Favorite Futures: Futuros
 
Posts: 88 since Apr 2011
Thanks: 851 given, 23 received

Could you help me with this risk control? I have created an strategy with two targets for the Ninja Trader ATM DOM, both of them with 8ticks of inicial stop, then I put a trailing stop with frequency on ONE. But what Im looking for is that, when the trade goes bad, itch tick it goes back, the target also goes back one tick as the profit. Do you get it? An example: My stop is 8, and my target is also on 8, but if it goes bad, ich tick it goes, the stop will be 7, the target 7... Thats it, waiting for answers. Thank you!

Reply With Quote
 
  #29 (permalink)
Elite Member
Bala, PA, USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus, IB
Favorite Futures: SPY, Oil, Euro
 
monpere's Avatar
 
Posts: 1,858 since Jul 2010
Thanks: 300 given, 3,276 received


Felix trader View Post
Could you help me with this risk control? I have created an strategy with two targets for the Ninja Trader ATM DOM, both of them with 8ticks of inicial stop, then I put a trailing stop with frequency on ONE. But what Im looking for is that, when the trade goes bad, itch tick it goes back, the target also goes back one tick as the profit. Do you get it? An example: My stop is 8, and my target is also on 8, but if it goes bad, ich tick it goes, the stop will be 7, the target 7... Thats it, waiting for answers. Thank you!

I don't do any trade management within the indicator, and I am not a fan of instantiating a strategy from within an indicator. All my trade management is done in a stand alone strategy started in the strategy tab.

Reply With Quote
The following user says Thank You to monpere for this post:
 
  #30 (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


I wrote an indicator that is intended to automatically exit trades while still being able to use the ChartTrader to enter trades. So in other words, Manual Entry --- Automated Exit.

This code does not have buttons and runs just like any other indicator. It's very basic as you can tell by looking at the code. However, there is a problem that I need help with. The ExitShort or ExitLong causes an error "Object reference not set to an instance of an object."

I'm not sure what object reference it's referring to and have spent a lot of time trying to figure it out. So, I thought I'd present it here to see if anyone else can figure it out.

Once this problem is solved I can move on to making this indicator more functional...I hope.

Thanks,
Mike

Attached Files
Register to download File Type: cs ManageTrades.cs (7.8 KB, 53 views)
Reply With Quote
The following user says Thank You to MWinfrey for this post:

Reply



futures io > > > > Manual entry, automated exit (Ninja Trader or other)?

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
Combined auto-entry and manual-exit strategy as a money management device nanobiotech Psychology and Money Management 10 January 31st, 2015 08:51 AM
Entry/Exit optimization strategy vetl Elite Automated Trading 11 June 20th, 2014 08:13 AM
Manual Entry Strategy Shell Xav1029 The Elite Circle 2 May 7th, 2014 09:51 PM
What is the highest win% you have seen a trading system, automated or manual, have? ElectricWiz Traders Hideout 29 May 8th, 2012 07:00 PM
NINJA TRADER manual entry / management of......... mdsvtr NinjaTrader 3 November 5th, 2010 04:49 AM


All times are GMT -4. The time now is 02:26 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-12 in 0.13 seconds with 40 queries on phoenix via your IP 54.90.207.75