Operation not executed  [SOLVED]

Questions about MultiCharts and user contributed studies.
simoneb
Posts: 21
Joined: 18 Apr 2023
Has thanked: 3 times
Been thanked: 1 time

Operation not executed

Postby simoneb » 20 May 2023

I'm live trading this strategy using a real connection to Interactive Brokers (a paper trader account, but still a real connection to IB).

Image

This strategy as you can see is automated and enterer a long position with a stop order on that bar. Nevertheless, the order never occurred and there's no trace of it in MultiCharts orders tab of the position tracker, nor in the broker, nor there are any errors in the logs.

Does anybody know how and why this may happen? The only thing I can't think of, considering that there's no trace of that order, is that the auto trading was not active at the time of the entry, but I'm fairly confident that the strategy was always active, so I wonder if there are any other possible explanations.

User avatar
Polly MultiCharts
Posts: 189
Joined: 20 Jul 2022
Has thanked: 1 time
Been thanked: 52 times

Re: Operation not executed

Postby Polly MultiCharts » 22 May 2023

Hi simoneb,

When you’re using AA mode, the trades are plotted on the chart when the order generation conditions are met with no respect to the real order executions on the broker. There are 3 separate market positions when strategy is auto trading in MultiCharts:
  1. Broker position. This is the net position for a traded security at your broker account that takes into consideration all trades.
  2. Auto trading engine position. This is the inner position of the strategy on a specific chart calculated by the software.
  3. Chart position. This is the position generated by orders visually executed on a chart.
When you auto trade in SA (sync. mode) the 2 and 3 are the same, what you see on the chart is synchronized with the auto trading engine. When you use AA (async. mode), you may have to deal with 3 different positions: what you have on broker, what you see on chart, what MC thinks it is. Here is more info about it.

Also please note that orders are generated according to the logic of a signal script.
Please add traces in your code (print, fileappend) to find out why your strategy decided to place an order, (or not to place) in a particular case.
A general example is available in our Wiki.

simoneb
Posts: 21
Joined: 18 Apr 2023
Has thanked: 3 times
Been thanked: 1 time

Re: Operation not executed

Postby simoneb » 26 May 2023

Hi Polly, thanks for your answer, but I don't understand how it explains the scenarios I described. The strategy should have entered long, but MC didn't even try to place any order. In the Orders tab of the Orders and Positions Tracker window, there's no trace of that order.

What you explain and the documentation you link to seem to describe scenarios when the order was rejected by the broker, but in this case the order wasn't generated by MC in the first place. Can you think of any other explanation for why it may happen?

User avatar
Polly MultiCharts
Posts: 189
Joined: 20 Jul 2022
Has thanked: 1 time
Been thanked: 52 times

Re: Operation not executed  [SOLVED]

Postby Polly MultiCharts » 30 May 2023

simoneb,

If there is no order in the Order and Position Tracker it means that it was not generated by the strategy. In that case you can add traces in your code (print, fileappend) to find out why your strategy decided to place an order, (or not to place) in a particular case.
A general example is available in our Wiki.
In this article you can find just the examples. Only the script developer knows which values shall be traced in the code to analyze its operation.


Return to “MultiCharts”