Can someone help me w/ this code - futures io
futures io futures trading



Can someone help me w/ this code


Discussion in NinjaTrader

Updated
    1. trending_up 882 views
    2. thumb_up 0 thanks given
    3. group 1 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
 

Can someone help me w/ this code

(login for full post details)
  #1 (permalink)
baltimore marylnd
 
Experience: Beginner
Platform: ninja
Trading: es
 
Posts: 91 since May 2013
Thanks: 5 given, 11 received

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.

Started this thread Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(154 thanks from 29 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(111 thanks from 32 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(31 thanks from 16 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
baltimore marylnd
 
Experience: Beginner
Platform: ninja
Trading: es
 
Posts: 91 since May 2013
Thanks: 5 given, 11 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=''

Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
NC, USA
 
Experience: None
Platform: None Yet
Trading: Guitar
 
MrYou's Avatar
 
Posts: 403 since Jun 2011
Thanks: 618 given, 196 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
 
(login for full post details)
  #5 (permalink)
baltimore marylnd
 
Experience: Beginner
Platform: ninja
Trading: es
 
Posts: 91 since May 2013
Thanks: 5 given, 11 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!

Started this thread Reply With Quote
 
(login for full post details)
  #6 (permalink)
NC, USA
 
Experience: None
Platform: None Yet
Trading: Guitar
 
MrYou's Avatar
 
Posts: 403 since Jun 2011
Thanks: 618 given, 196 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


futures io Trading Community Platforms and Indicators NinjaTrader > Can someone help me w/ this code


Last Updated on June 4, 2013


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Identifying Setups & Targets Using Profile Charts w/Trevor & Tradovate

Feb 25
 

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

March
     



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