My understanding is that I need to use Atm strategies in order to place orders in my strategy because....
** #1. I get errors with EnterShortStopLimit(quantity, orderPrice, orderPrice + (DefaultStopTicks * TickSize), ...
Specifically, "Sell stop or sell stop limit orders can't be placed above the market."
Everything works with the atm strategy and AtmStrategyCreate() because I only specify the limit order price and all is good with the stop riding nicely in the atm strategy.
** #2. Orders placed with EnterLongLimit() are placed with targets but I can't edit the targets by hand with chart trader and I need flexibility. I tried SubmitOrderUnmanaged() but it didn't work on the first pass and requires more investigation.
** #3. I want to set the number of shares because I want to calculate how much margin I have left so that I don't try to place an order that's past my limits.
int maxQuantity = (int)(double)Math.Floor(Strategy.Account.Get(AccountItem.[B]ExcessInitialMargin[/B], Currency.UsDollar) / Strategy.MarginEntryRequirement); int quantity = Math.Min(Strategy.DefaultQuantity, maxQuantity);
** #4. I also want to use the same strategy for 5 different markets and change the share price (and maybe stop amounts) on the fly.
The problem is that the number of shares is set and fixed in the strategy.
Thanks in advance for any comments or suggestions or other ways to do any part of this.
I mentioned 4 different apis that I tried....
- AtmStrategyCreate
- EnterShortStopLimit
- EnterLongLimit
- SubmitOrderUnmanaged
Comment