Orders are either"limit, or "stop if bid" Meaning, a target to be reach. easy for me to manually manage on medium time scale. If targer not reach, cancelled them.
A "flag" is a deformation from my work with microcontroler where a flag or an indicator is raised after the completion of a task. A communication channel between interface and microcontroler.
I understand the principle to look indirectly for the currentcontract at the beginning and at ending of a bar. Using my experience with (microcontroler controled process, i was looking for a direct responce from MC
I will try your little code and see if money keep rolling for me. If it does, you could sure that i wont forget you. I never make any money over somebody else.
Have a great day
Please excuse my bad English as I'm more fluent in French
After some chat with MC, it seems that the solution migth be to use the Synchronisation mode.
In this mode, MC will wait for a confirmation from broker before modifying is value.
[LEFT]Synchronous Mode for Auto Trading
The synchronous auto trading mode (SA) is a mode where entry/exit arrows are plotted on the chart only after orders have
been executed at the broker.
The synchronous auto trading mode ensures avoiding discrepancies between the market position on the chart and the market
position at the broker. The following conditions must be met in order for the synchronous auto trading mode to work properly:
1. The same symbol cannot be traded from more than one chart. Trading the same symbol from two or more charts
will cause a market position conflict between the charts.
2. The market position at the broker must be 0 at the time when auto trading is launched.
3. A trader must not trade the symbol directly through the brokerís platform while trading the same symbol through
4. At the moment of connection loss, the broker did not send notifications about complete order filling or cancellation.