Can someone help me w/ this code - NinjaTrader Programming | futures io social day trading
futures io futures trading


Can someone help me w/ this code
Updated: Views / Replies:541 / 5
Created: by calhawk01 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
 

Can someone help me w/ this code

  #1 (permalink)
Elite Member
baltimore marylnd
 
Futures Experience: Beginner
Platform: ninja
Favorite Futures: es
 
Posts: 69 since May 2013
Thanks: 1 given, 6 received

Can someone help me w/ this code

hi, i'm not a programer but i've literally spent the last three weeks trying to solve this one problem for one of my strategy and i cant seem to get it to work properly. NT support blows as they suggest me hiring a consultant.

here is what i'm trying to do:

when I enter the position, enter a limit stoploss (this works fine)
if high[0] > target1, then move my stoploss to avg.price
if high[0] > target2, then move my stoploss to target1
if high[0] > target3, then move my stoploss to target2

i have read bigmike's video totorial on something very similar to this but his tutorial is based on three contracts, my intend is to only buy 1 contract and modify it's stoplosses as market conditions change.

I have tried several things to get this to work properly but nothing works, it seems the orders are being submitted in the tracelog but during my backtest it's not executing any of my stoplosses:

 
Code
private void GoLong()
		{
			SetStopLoss("target1", CalculationMode.Price, Close[0] - (Stop*TickSize), false);		
			EnterLong("target1");
		}
		
		private void ManageOrders()
		{
			if (Position.MarketPosition == MarketPosition.Long)
			{
				if (Close[0] > Position.AvgPrice + (Target1*TickSize))
					SetStopLoss("target2", CalculationMode.Price, Position.AvgPrice, false);
			}
		}
		private void ManageOrder2()
		{
			if (Position.MarketPosition == MarketPosition.Long)
			{
				if (Close[0] > Position.AvgPrice + ((Target1+Target2)*TickSize))
					SetStopLoss("target3", CalculationMode.Price, Position.AvgPrice + (Target1*TickSize), false);
			}		
		}
		private void ManageOrder3()
		{
			if (Position.MarketPosition == MarketPosition.Long)
			{
				if (Close[0] > Position.AvgPrice + ((Target1+Target2+Target3)*TickSize))
					SetStopLoss("target3", CalculationMode.Price, Position.AvgPrice+ ((Target1+Target2)*TickSize), false);
			}		
		}
and then i've dropped manageorders, manageorder2, manageorder3 in onbarupdate();

tracelog:

 
Code
5/31/2013 9:37:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target1' Mode=Price Value=1645.25 Currency=0 Simulated=False
5/31/2013 9:37:00 AM Entered internal PlaceOrder() method at 5/31/2013 9:37:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='target1' FromEntrySignal=''
5/31/2013 9:43:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:44:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:45:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:46:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:48:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:49:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:50:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:51:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:52:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:53:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:54:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:55:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 9:56:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:01:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:02:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:04:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:06:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:33:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:38:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:39:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:40:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:41:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:44:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:46:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 10:47:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:05:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:06:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:07:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:08:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:09:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:09:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:10:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:10:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:11:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:11:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:12:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:12:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:13:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:13:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:14:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:14:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:15:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:15:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:16:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:16:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:17:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:17:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:18:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:18:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:19:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:19:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:20:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:20:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:21:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:21:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:22:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:22:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:23:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:23:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:24:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:24:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:25:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:25:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:26:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:26:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:27:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:27:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:28:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:28:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:29:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:29:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:30:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:30:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:31:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:31:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:32:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:32:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:33:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:33:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:34:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:34:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:35:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:35:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:36:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:36:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:37:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:37:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:38:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:38:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:39:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:39:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:40:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:40:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:41:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:41:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:42:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:42:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:43:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:43:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:44:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:45:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:45:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:46:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:46:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:47:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:47:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:48:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:48:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:49:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:49:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:50:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:50:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:51:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:52:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:52:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:53:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:53:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:54:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:54:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:55:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:55:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target3' Mode=Price Value=1651.25 Currency=0 Simulated=False
5/31/2013 11:56:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:57:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:58:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 11:59:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:00:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:01:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:02:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:03:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:04:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:08:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:09:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:10:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:11:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:28:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:29:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:35:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:36:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:38:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:39:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:40:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:43:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:44:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:45:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:46:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:47:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:48:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:49:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:50:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:51:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 12:52:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:04:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:05:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:06:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:07:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:08:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:09:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:10:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:11:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:12:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:13:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:14:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:15:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:16:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:17:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:18:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:19:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:20:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:21:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:22:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:23:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:24:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:25:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:26:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:27:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:28:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:29:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 1:30:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='target2' Mode=Price Value=1648.25 Currency=0 Simulated=False
5/31/2013 3:57:00 PM Entered internal PlaceOrder() method at 5/31/2013 3:57:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
5/31/2013 3:57:00 PM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
as you can clearly see that my original stoploss is being set correctly, but when my conditions in manageorders, manageorder2 and manageorder3 are being true, it is being recognized in tracelog? but the order is not being submitted.

any ideas what's going on.

thank you in advance.

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
baltimore marylnd
 
Futures Experience: Beginner
Platform: ninja
Favorite Futures: es
 
Posts: 69 since May 2013
Thanks: 1 given, 6 received


i have also tried this:

 
Code
		private void GoLong()
		{
			SetStopLoss("stop1", CalculationMode.Price, Close[0] - (Stop*TickSize), false);		
			EnterLong(DefaultQuantity,"");
		}
		
		private void ManageOrders()
		{
			if (Position.MarketPosition == MarketPosition.Long)
			{
				if (High[0] > Position.AvgPrice + (Target1*TickSize))
					SetStopLoss("target11", CalculationMode.Price, Position.AvgPrice, false);
			
			
				if (High[0] > Position.AvgPrice + ((Target1+Target22)*TickSize))
					SetStopLoss("target22", CalculationMode.Price, Position.AvgPrice + (Target1*TickSize), false);
			
			
				if (High[0] > Position.AvgPrice + ((Target1+Target22+Target3)*TickSize))
					SetStopLoss("target33", CalculationMode.Price, Position.AvgPrice+ ((Target1+Target22)*TickSize), false);
			}		


		}
this one is super weird, as the tracelog shows that the stoploss is being set, but the stoploss is never hit even though price plummets right through it

 
Code
5/31/2013 9:37:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='stop1' Mode=Price Value=1645.25 Currency=0 Simulated=False
5/31/2013 9:37:00 AM Entered internal PlaceOrder() method at 5/31/2013 9:37:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''

Reply With Quote
 
  #4 (permalink)
Elite Member
NC, USA
 
Futures Experience: None
Platform: None Yet
Favorite Futures: Guitar
 
MrYou's Avatar
 
Posts: 403 since Jun 2011
Thanks: 618 given, 193 received


calhawk01 View Post
NT support blows as they suggest me hiring a consultant.

This is a reasonable suggestion considering NT support is not in the business of helping customers write their code.

At first glance it appears you are using "fromEntrySignal" incorrectly. From the documentation:

"The entry signal name. This ties the stop loss exit to the entry and exits the position quantity represented by the actual entry."

EDIT: Hint, they need to match your entries or discard them.

Reply With Quote
 
  #5 (permalink)
Elite Member
baltimore marylnd
 
Futures Experience: Beginner
Platform: ninja
Favorite Futures: es
 
Posts: 69 since May 2013
Thanks: 1 given, 6 received


MrYou View Post
This is a reasonable suggestion considering NT support is not in the business of helping customers write their code.

At first glance it appears you are using "fromEntrySignal" incorrectly. From the documentation:

"The entry signal name. This ties the stop loss exit to the entry and exits the position quantity represented by the actual entry."

EDIT: Hint, they need to match your entries or discard them.

thx for the reply

i respect your opinion, i for one think that they sell a product and charge people money for it, they should support it. i font want to hand over my strategy to a ''consultant.'' i think that's crazy.

and i'm sorry i'm not understanding your hint!

Reply With Quote
 
  #6 (permalink)
Elite Member
NC, USA
 
Futures Experience: None
Platform: None Yet
Favorite Futures: Guitar
 
MrYou's Avatar
 
Posts: 403 since Jun 2011
Thanks: 618 given, 193 received


calhawk01 View Post
and i'm sorry i'm not understanding your hint!

You need to match your "target#" with an equivalent entry:

EnterLong(DefaultQuantity, "target1");

or

EnterShort(DefaultQuantity, "target1");

or leave the signal name empty ("") for both entries and SetStopLoss(). They need to match or discard them.

Reply With Quote

Reply



futures io > > > > > Can someone help me w/ this code

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
what does this code mean? ticker NinjaTrader Programming 2 April 11th, 2013 02:56 AM
need a coder to code new NT7 indi from existing MT4 indi - I have source code traderdp Hire a Consultant or Programmer 0 January 31st, 2013 09:21 PM
Better Momentum's "code #" I Lost...r all code #'s same ? xm4730 ?? Billbb Platforms and Indicators 2 January 26th, 2012 07:15 PM
Converting code Jbird10 EasyLanguage Programming 3 December 22nd, 2011 09:04 PM
Can someone code this ? skyfly NinjaTrader Programming 8 April 25th, 2011 01:40 PM


All times are GMT -4. The time now is 05:19 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-14 in 0.11 seconds with 19 queries on phoenix via your IP 54.221.73.186