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)
I declare my 2 orders with the following code:
private IOrderPriced m_entryShort_SellOrder;
private IOrderPriced m_exitStop_BuyOrder;
in the "Create()" method I set the type of order:
m_entryShort_SellOrder = OrderCreator.Stop(new
SOrderParameters(Contracts.UserSpecified, "EntryShort",
EOrderAction.SellShort));
m_exitStop_BuyOrder = OrderCreator.Stop(new
SOrderParameters(Contracts.UserSpecified, "SStopOrder",
EOrderAction.BuyToCover));
when the condiction is verificated, I send orders with this mode:
m_entryShort_SellOrder.Send(m_OrderShortPrice, m_NumOrder);
where "(double) m_OrderShortPrice" is the price, "(int) m_NumOrder" is the number of lots (default: 1), and every candle I re-insert order with:
m_entryShort_SellOrder.Send(m_OrderShortPrice, m_NumOrder);
I noticed that the order wants to be re-inserted every candle, it's right?.
Now I want that the strategy to handle multiple simultaneous orders. Every order is made of a single contract and every position has its own target and stop. So these are the questions:
Q1. is there a solution to read/get a value Order_ID for the order that I send into MC ?
Q2. is there a method or a variable that I can get in order to read the status of every single order? (ie. order flat, order in place, order close by target, order close by stop,ect.)? If yes, can you explain me, with some source code for examples? If not comes the Q3:
Q3. Example: I made 4 orders, 2 are still in position and 2 are already closed, may I discriminate which order is closed to the target/stop, in order to continue to re-insert target/stop for the others that are still opened? Does MC give this chance?
ABCTG
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623
MarcOne,
please follow what I wrote above when you want others to take a look at the code problems. The code should be complete and should verify, as the snippets might not show the problem. You don't have to reveal your logic of course, as you can change your logic with something else - so long the problems persist in this new demo code.
For your questions, the orders have a property for the ID and you could subscribe to the TradeManager, which might give you the other information you are looking for (but it might be more complex). There are examples for that in the official MC forum.
You can also check the order names and prices for each trade your signal made, this should give you access to which orders were filled, too.
I am sure there are examples for that in the forum, but the programming guide covers all you need: https://www.multicharts.com/downloads/MultiCharts.NET-ProgrammingGuide-v1.1.pdf