The "Buy"/"Sell" behavior when on broker side  [SOLVED]

Questions about MultiCharts and user contributed studies.
ragdoll
Posts: 49
Joined: 04 Apr 2019
Has thanked: 4 times

The "Buy"/"Sell" behavior when on broker side

Postby ragdoll » 08 Aug 2020

An order is executed at the point specified by the parameters; if the order is not filled within the specified bar, the order is cancelled.
I understand the above logic when in back test. However, I wonder what's the behavior of the buy/sell order when it is sent to broker. Is the order sent out to broker will be expired after the next bar close? (A timeout parameter has been sent out with the order by broker's API through Multicharts).

I also notice the following options in auto trade tab, "Unfilled Strategy Order Replacement" and "Partially Filled Orders Replacement". If I do not want the buy/sell order expire on the broker side, I was suggested to set these two options. Right?

Thanks.

User avatar
Tammy MultiCharts
Posts: 200
Joined: 06 Aug 2020
Has thanked: 6 times
Been thanked: 65 times

Re: The "Buy"/"Sell" behavior when on broker side

Postby Tammy MultiCharts » 14 Aug 2020

Hello ragdoll,

In auto trading the order will stay at the broker until the conditions for its generation are met on each script calculation.
For instance, buy next bar at 1.17640 limit order will be active until it is executed.

The Time in Force Settings of each broker plugin should also be taken into consideration (e.i. DAY, GTC (good till cancelled), IOC (immediate or cancel) etc.)

To find out more information about Order Replacement function, please refer to this article: https://www.multicharts.com/trading-sof ... eplacement

ragdoll
Posts: 49
Joined: 04 Apr 2019
Has thanked: 4 times

Re: The "Buy"/"Sell" behavior when on broker side

Postby ragdoll » 14 Aug 2020

In this case, the behaviour of the simulation is not in line with the active trade. How can I rely on the results of simulation? Thanks.

ragdoll
Posts: 49
Joined: 04 Apr 2019
Has thanked: 4 times

Re: The "Buy"/"Sell" behavior when on broker side

Postby ragdoll » 14 Aug 2020

Say I made an entry order and manually place stop order per bar as follows.

Code: Select all

if condition then buy 1 order at next bar on some_price limit; if marketposition = 1 then begin stop_price = some new stop price based on market; sell 1 order at next bar on stop_price stop; end;
If the stop order not filled on next bar, will it be cancelled on broker side by MC please? Otherwise, there will be a lot of stop orders on broker side.

ragdoll
Posts: 49
Joined: 04 Apr 2019
Has thanked: 4 times

Re: The "Buy"/"Sell" behavior when on broker side  [SOLVED]

Postby ragdoll » 18 Aug 2020

MC support provided the following answer via online chat:

In auto trading Price orders are valid at broker while they are sent by the strategy. That means the conditions for order generation should be met in your code on each bar close or each tick (if IOG=ON) calculation while you need to keep your orders active. If the conditions for order generation become invalid on a sequential calculation, the order is cancelled.

In general, the orders can be cancelled due to the following reasons:
1) script has stopped generating orders, then started generating them again;
2) different set of orders was generated on the new calculation;
3) market orders were generated by the code (requires to cancel the active price orders to send it);
4) due to the options from Auto Trading tab.


Return to “MultiCharts”