Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Max, in case you haven't already solved this, here's something simple to try to do a sanity check. I plan to do some testing with this period type soon as well, so good luck.
thank you,
i just tried it again on market replay to make shure my logic is right -
>> the ATM - order-cancelation works OK with a call from the main timeframe
It does not work with my trys from the second timeframe ...... there is a conflict somewhere i have to find.
Platform: NinjaTrader, TOS, Multicharts, Open Source various
Trading: FDAX, cable/yen, FX, options on commodities
Posts: 67 since Jun 2009
Thanks Given: 16
Thanks Received: 10
Hi Max,
Any chance you could post the code of the section you have that cancels the order? I have a good ATM strat but the cancel component is not working.
When I take out CurrentBar > barNumberOfOrder + 1 && I can get the orders to cancel(straight away but good for testing).
I have set TraceOrders = true; and from the output window can't see any errors. Even with print statements it looks good, the AtmCancelEntryOrder is called but doesn't actually cancel with CurrentBar > barNumberOfOrder + 1 . However, I can get it to cancel if I just call the cancel if any order is pending/working or accepted.
The NT site doesn't have any actual samples of working strats with AtmStrategyCancelEntryOrder(orderId); on it, just the command variable page.
Did you ever get it to work? If you have some working sample code you could post would really appreciate it!
Thanks for sharing the portion of your code. It appears mrticks and I are going through a similar learning experience.
A couple quick questions:
How are your Buy and Sell variables initially set? true or false? I'm assuming false with other conditions of your code creating the true condition.
When the condition sets Buy or Sell to true, do you also restate the other one to false (keeping them paired up throughout your code)?
Is this strat COBC = false;? I'm assuming false.
I've started my code off the SampleAtmStrategy which is a long only sample. How often would you use variables that are specifically long or short to keep them separated? I've tried orderIdL and orderIdS and atmStrategyIdL and atmStrategyIdS. Those seem to allow for going long AND short at the same time which could solve a bracketing type scenario but can create a mess also. Or if you have barNumber assignments do you use entryBarL = CurrentBar or just entryBar = CurrentBar?