NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 07-23-2010, 08:12 AM   #1
daven
Senior Member
 
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 329
Thanks: 0
Thanked 11 times in 8 posts
Default Multiple Entries witn an ATM Strategy

I have a strategy working based on the sample ATM strategy. I am getting entries as I expect but the problem is I am getting multiple entries. When placing the strategy on the chart what should the setting be to prevent multiple entries for the strategy in the same direction? (I currently have "Entry handling" set for unique entries since that is what worked for the earlier version of this strategy which used named entries for multiple contract trades.) Should it actually be: AllEntries?

Also, in the Sample ATM Strategy, which part of the code checks to see if there is already a strategy in place?

Thanks
DaveN
daven is offline  
Reply With Quote
Old 07-23-2010, 08:32 AM   #2
NinjaTrader_Tim
NinjaTrader Customer Service
 
NinjaTrader_Tim's Avatar
 
Join Date: Nov 2009
Location: Denver, CO
Posts: 1,424
Thanks: 0
Thanked 3 times in 3 posts
Default

Hi daven,

Yes, "AllEntries" is what you'll want to use here.
http://www.ninjatrader-support.com/H...xEntryHandling

Can you clarify "which part of the code checks to see if there is already a strategy in place?" When you submit a strategy, there is no default method to check if there is one running already.
NinjaTrader_Tim is offline  
Reply With Quote
Old 07-23-2010, 08:41 AM   #3
daven
Senior Member
 
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 329
Thanks: 0
Thanked 11 times in 8 posts
Default

Is there another way to see if I have a strategy running already that i could place in the code prior to entering a new strategy? I am getting multiple strategy entries in both directions and it is really a mess. I've tried running the strategy with Entry Handling in both modes (unique entries, and all entries) and it doesn't seem to make any difference. I don't want to enter another trade until the previous entry is closed out. That is what i need to check for.
Thanks
DaveN
daven is offline  
Reply With Quote
Old 07-23-2010, 08:57 AM   #4
daven
Senior Member
 
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 329
Thanks: 0
Thanked 11 times in 8 posts
Default

Let me clarify my question. i already had in the code the following condition:

"Position.MarketPosition == MarketPosition.Flat"

I did this to ensure that I didn't enter a new trade until the previous trade was flat either by profit targets or a stop out. That condition is still in my code after converting it to entering an ATM order instead of a straight long or short entry, but it appears that condition no longer works? If I check in my trade logic if I am long, short, or flat, since I have launched an ATM strategy and my entry is now being controlled by the named ATM, am I unable to determine my current position?
DaveN
daven is offline  
Reply With Quote
Old 07-23-2010, 09:30 AM   #5
daven
Senior Member
 
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 329
Thanks: 0
Thanked 11 times in 8 posts
Default

I think I found what I am looking for but I want to make sure I understand how to use it. The first line of the quote sample below...if(ordirId.Length == 0 && atmStrategyId.Length == 0.... appears to be a test to see if there is already an active ATM Strategy running. Is that correct? If so, what happens with this test if I am running two different ATM strategies on two different charts? Will they interact and possibly detect one another's presence? I don't want to know if there is any active ATM strategy running anywhere, I just want to know if there is one active on the particular chart I am running this strategy on. I don't know if what I am asking is clear, if not, let me know and I'll try to phrase my question more intellilgently.
Thanks
DaveN


Quote:
if (orderId.Length == 0 && atmStrategyId.Length == 0
&& High[1] >= MAX(High, MMHiLo_LB)[2]
&& High[0] < High[1]
daven is offline  
Reply With Quote
Old 07-23-2010, 09:43 AM   #6
NinjaTrader_Tim
NinjaTrader Customer Service
 
NinjaTrader_Tim's Avatar
 
Join Date: Nov 2009
Location: Denver, CO
Posts: 1,424
Thanks: 0
Thanked 3 times in 3 posts
Default

Hi daven,

For this you can use GetAtmStrategyMarketPosition()
http://www.ninjatrader-support.com/H...rategyPosition
NinjaTrader_Tim is offline  
Reply With Quote
Old 07-23-2010, 10:15 AM   #7
daven
Senior Member
 
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 329
Thanks: 0
Thanked 11 times in 8 posts
Default

Okay, I've incorporated that last command in and commented out the orderid length and atmstrategy id length test out, so we'll see how it runs no. Am I correct in my interpretation that if I do the orderIdlength == 0 and AtmStrategyId.Length == 0 test I am looking for any atm strategy running on any chart, (not just the one the current strategy is running)/
Thanks
DaveN
daven is offline  
Reply With Quote
Old 07-23-2010, 11:52 AM   #8
daven
Senior Member
 
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 329
Thanks: 0
Thanked 11 times in 8 posts
Default

Just an update here. It appears that adding that getatmposition test has helped greatly. I still got one additional entry resulting in a double position so I have more work to do, but so far it is a lot better. I am looking at output in an output window to see what is going on but for some reason I am getting this endless stream of tic information, (example below).
Any idea what that is coming from ? It is not there because of anything I have set in this strategy and it is really interfering with my ability to see what is going on in the program. Any idea how I can stop it?
Thanks
DaveN

7/23/2010 11:05:19 AM size of tick 4 DIR 1
7/23/2010 11:05:19 AM size of tick 4 DIR 1
7/23/2010 11:05:19 AM size of tick 1 DIR 1
7/23/2010 11:05:19 AM size of tick 1 DIR 1
7/23/2010 11:05:19 AM size of tick 5 DIR 1
7/23/2010 11:05:19 AM size of tick 5 DIR 1
7/23/2010 11:05:19 AM size of tick 1 DIR 1
7/23/2010 11:05:19 AM size of tick 1 DIR 1
7/23/2010 11:05:19 AM size of tick 1 DIR 1
7/23/2010 11:05:19 AM size of tick 1 DIR 1
7/23/2010 11:05:20 AM size of tick 1 DIR 1
7/23/2010 11:05:20 AM size of tick 1 DIR 1
7/23/2010 11:05:20 AM size of tick 1 DIR 1
7/23/2010 11:05:20 AM size of tick 1 DIR 1
7/23/2010 11:05:20 AM size of tick 4 DIR 1
7/23/2010 11:05:20 AM size of tick 4 DIR 1
7/23/2010 11:05:20 AM size of tick 4 DIR 1
7/23/2010 11:05:20 AM size of tick 4 DIR 1
7/23/2010 11:05:20 AM size of tick 1 DIR 1
7/23/2010 11:05:20 AM size of tick 1 DIR 1
7/23/2010 11:05:20 AM size of tick 1 DIR 1
7/23/2010 11:05:20 AM size of tick 1 DIR 1
7/23/2010 11:05:20 AM size of tick 1 DIR 1
7/23/2010 11:05:20 AM size of tick 1 DIR 1
7/23/2010 11:06:00 AM size of tick 1 DIR -1
7/23/2010 11:05:20 AM size of tick 1 DIR -1
7/23/2010 11:05:20 AM size of tick 1 DIR -1
7/23/2010 11:05:20 AM size of tick 3 DIR -1
7/23/2010 11:05:20 AM size of tick 3 DIR -1
7/23/2010 11:05:20 AM size of tick 22 DIR -1
7/23/2010 11:05:20 AM size of tick 22 DIR -1
7/23/2010 11:05:20 AM size of tick 1 DIR -1
daven is offline  
Reply With Quote
Old 07-23-2010, 12:00 PM   #9
NinjaTrader_Tim
NinjaTrader Customer Service
 
NinjaTrader_Tim's Avatar
 
Join Date: Nov 2009
Location: Denver, CO
Posts: 1,424
Thanks: 0
Thanked 3 times in 3 posts
Default

Hi daven,

This is in the output window? Do you have any Print()'s in your code that could explain it?
NinjaTrader_Tim is offline  
Reply With Quote
Old 07-23-2010, 12:54 PM   #10
daven
Senior Member
 
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 329
Thanks: 0
Thanked 11 times in 8 posts
Default

Yes, it is in the output window and I do have print statements like this one:
[QUOTE][Print(counter + " " + "Executing ATM_Buy");
Print(PT_BarColorMapper_Mod3(5).BCMText[0] + " " + PT_BarColorMapper_Mod3(5).BCMText[1] );/QUOTE]

But nothing putting out tic information or anything like that. I am mystified because I can see nothing running that would account for this kind of data going into the output window. Is there some kind of generic setting somewhere in the options that could create this kind of repetitive output?
daven is offline  
Reply With Quote
Old 07-23-2010, 01:22 PM   #11
daven
Senior Member
 
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 329
Thanks: 0
Thanked 11 times in 8 posts
Default Found it.

I found the culprit. A friend of mine wrote an indicator which sorts out block trades and prints them in the upper corner of the chart. It is a very cool indicator because you can see when large size starts to pile in the market either buying or selling and if the size is big and fast enough it can move the market. It broadcasts tics and that is what is going into the output window. I will see if there is a way to suppress that function without ruining the indicator which is really cool.
Thanks for your help.
DaveN
Attached Images
File Type: png Radar_Pix.png (8.1 KB, 7 views)
daven is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
concurrent 'multiple ATM strategy' questions.. sev888 ATM Strategies (Discretionary Trading) 8 09-20-2010 11:42 AM
ATM strategy selection modes and multiple entries tomgilb ATM Strategies (Discretionary Trading) 12 10-08-2009 02:26 PM
Chart Trader: Condition based entries, time-axis entries, multiple OCO pairs etc. Elliott Wave Suggestions And Feedback 1 11-25-2008 03:23 AM
Coordinate Multiple strategy entries maninjapan General Programming 7 06-04-2008 02:04 AM
Multiple order ATM strategy ericgood ATM Strategies (Discretionary Trading) 5 03-11-2008 01:18 PM


All times are GMT -6. The time now is 01:45 PM.