![]() |
|
|||||||
| Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Apr 2006
Location: Toronto
Posts: 1,321
Thanks: 1
Thanked 7 times in 7 posts
|
I am getting uncovered positions trading live cash
this is because I am using AtmStrategyClose which is reversing me due to race condition I would much prefer to be able to 'FlattenEverything' from my code instead of closing each position separately....this would negate any possibility of a race condition reverse Is this possible in 7? |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Apr 2006
Location: Toronto
Posts: 1,321
Thanks: 1
Thanked 7 times in 7 posts
|
or possibly this would work in conjunction with AtmStrategy code?
if (Position.MarketPosition == MarketPosition.Long ) { ExitLong(); Print(" "); Print(" EXIT UNCOVERED LONG "+ToTime(Time[0]) ); } else if ( Position.MarketPosition == MarketPosition.Short ) { ExitShort(); Print(" "); Print(" EXIT UNCOVERED SHORT "+ToTime(Time[0]) ); } return; |
|
|
|
|
|
#3 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
ATI user,
NS entry/exit method/properties would not influence your ATM strategy calls. Meaning, if you entered a position via AtmStrategyCreate, Position.MarketPosition would not pick it up as a long/short as that is not a NinjaScript position.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Mar 2008
Location: UK West Sussex
Posts: 667
Thanks: 10
Thanked 11 times in 8 posts
|
Ati user
I don't use strategies but would an oif work? CLOSEPOSITION COMMAND CLOSEPOSITION;<ACCOUNT>;<INSTRUMENT>;;;;;;;;;; I believe this is the equivalent of hitting the close button in ChartTrader and has never resulted in the conditions you have experienced. ( search order instruction files after F1 help) |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Apr 2006
Location: Toronto
Posts: 1,321
Thanks: 1
Thanked 7 times in 7 posts
|
Josh
Thanks. I had a suspicion they might be handled differently Mindset Thanks. OIFs are new to me and seem like the solution. I would want to use FLATTENEVERYTHING;;;;;;;;;;;; now I need to read up on how to implement them. You say you do not use strategies....does this mean you use your own custom command code instead? i.e. OIFs |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Mar 2008
Location: UK West Sussex
Posts: 667
Thanks: 10
Thanked 11 times in 8 posts
|
Ati user
Yes - I am a discretionary rule based trader and I tried for years to get a coded strategy to fit me but did not succeed. oif's are ok but be aware they don't do simulated orders so if you want say a neg stop limit order - you can't do it. They are also a real pain to write correctly so use the oif builder(tools-options-ati). |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Mar 2008
Location: UK West Sussex
Posts: 667
Thanks: 10
Thanked 11 times in 8 posts
|
Josh
Could you outline why NT doesn't see an oif order fill as a position - is there any way to use position commands on oif orders in v7 perhaps? |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Apr 2006
Location: Toronto
Posts: 1,321
Thanks: 1
Thanked 7 times in 7 posts
|
in another thread
Last edited by ATI user; 12-15-2009 at 08:36 AM.
|
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Apr 2006
Location: Toronto
Posts: 1,321
Thanks: 1
Thanked 7 times in 7 posts
|
I am writing an oif.txt file to NinjaTrader 7/incoming folder
the file shows up(see attached) but is not executed...in sim101 ...live feed....i.e. positions and stops are left open text is from OIF Builder...where Write File was checked ATI is enable from File menu WriteFile("oif3.txt", "FLATTENEVERYTHING;;;;;;;;;;;;"); |
|
|
|
|
|
#10 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Mindset,
OIFs are similar to manual trades. In 6.5 and 7, manually placed trades are not "seen" or managed by a NinjaScript Strategy.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
ATI user,
Any Control Center log messages?
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#12 |
|
Senior Member
Join Date: Apr 2006
Location: Toronto
Posts: 1,321
Thanks: 1
Thanked 7 times in 7 posts
|
none....had them when path was wrong....none since path is right and file is written in correct folder
Last edited by ATI user; 12-15-2009 at 11:29 AM.
|
|
|
|
|
|
#13 |
|
Senior Member
Join Date: Apr 2006
Location: Toronto
Posts: 1,321
Thanks: 1
Thanked 7 times in 7 posts
|
found bug....I assume
1. would not work so I thought maybe I needed to start NT with ATI enabled...did that....worked perfectly....ATI processing then executed in Log 2. then enabled strat....it restarted, wrote the iof file to incoming...however it was not executed 3. thought maybe I needed to remove the strat after a flatten, so I did....enabled new strat....wrote iof to folder however did not execute. so...unless you are only allowed to do this once, must be a bug related to not resetting something after flatten 4. question: flatten happens so fast I could not see the iof file written and deleted. Please confirm iofs are deleted from incoming folder after execution
Last edited by ATI user; 12-15-2009 at 12:25 PM.
|
|
|
|
|
|
#14 |
|
Senior Member
Join Date: Apr 2006
Location: Toronto
Posts: 1,321
Thanks: 1
Thanked 7 times in 7 posts
|
5. same results exactly as above when running in Market Replay....i.e. works perfectly once after restart and then not again
the help notes say you can test in 'live feed....' inferring it maybe would not work in MR...glad it does NOTE: switching feeds does not reset the function...you must restart NT
Last edited by ATI user; 12-15-2009 at 12:20 PM.
|
|
|
|
|
|
#15 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
ATI user,
I am not experiencing the same thing. 1. Connect data feed 2. Run SampleMACrossOver 3. As it enters a trade, Tools>Options>ATI>OIF builder 4. Submit FlattenEverything OIF 5. Trade closes, strategy shut down as expected. 6. Reenable strategy, strategy trades 7. Submit FlattenEverything OIF 8. Positions all exited again, strategy shut down. On OIF processing the OIF is deleted from the incoming folder. Please confirm this behavior on your end. If your OIF is removed from the folder it means it was processed. Please see the Control Center logs for messages related to the OIF processing. If it was not processed the OIF file would still be in your directory.
Josh
NinjaTrader Customer Service |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| race condition atm strats | ATI user | Version 7 Beta General Questions & Bug Reports | 12 | 01-21-2010 02:17 PM |
| Race Condition Issue and Order Reject | dax3k | Automated Trading | 7 | 04-06-2009 08:19 AM |
| race condition between exitorder and SetTrailStop | junkone | Automated Trading | 3 | 03-27-2009 02:20 PM |
| Race Conditions | TAJTrades | Strategy Development | 11 | 12-15-2008 07:19 AM |
| multi-time frame code and entry code | Mark_486 | General Programming | 1 | 05-15-2008 11:54 AM |