×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts
Open main menu

Changes

From Broker To Strategy MP Synchronizer

1 byte added, 14:45, 14 September 2021
no edit summary
On each strategy calculation, the signal compares chart position with broker position. If the difference between these two positions is detected, TimeOutMS timer starts counting down. If by the end of the specified period the positions don’t get equal, then [[ChangeMarketPosition]] order will be sent in auto trading system. This event will activate the next timer specified in LatencyMS input. LatencyMS determines how much time to wait before the next synchronization. If during the period specified for LatencyMS the ChangeMarketPosition order is not filled, the synchronizing signal sends another synchronizing order which will send the second notification on the chart.
=== How to choose timeouts=== <br>
1) Use [[Print]] statement in your script to output computer time in ms and three market positions:
([[MarketPosition]], [[MarketPosition_at_Broker]], [[MarketPosition_at_Broker_for_the_Strategy]]);<br>
2) Use Print statement in your script to output computer time in milliseconds and the fact of execution of ChangeMarketPosition command.
=== Default Inputs ===
 
'''TimeOutMS''' sets the first timeout (in ms) that must be expired before the first synchronizing order is generated, 250 by default.<br>
The TimeOutMS value shouldn’t be less than the difference between the value from Order and Position Tracker -> Orders tab -> Filled/Cancelled column and the last market position change printed out to the Output for MarketPosition_at_Broker. At the same time, this parameter shouldn’t be bigger than the interval between sending orders to the broker (otherwise, the Synchronizer can go into the resonance).
'''LatencyMS ''' sets the second timeout (in ms) that must be expired before the second synchronizing order is generated, 500 by default.<br>
The LatencyMS value shouldn’t be less than the difference between the time of generating ChangeMarketPosition order and its execution. However, this time value shouldn’t be too big, because it corresponds to the period when the Synchronizer stays inactive after sending the synchronizing order.
 
 
=== Default Inputs ===
 
'''TimeOutMS''' sets the first timeout (in ms) that must be expired before the first synchronizing order is generated, 250 by default.
 
'''LatencyMS ''' sets the second timeout (in ms) that must be expired before the second synchronizing order is generated, 500 by default.
<div style="background-color: #E3FBE5;"> Note: The first timeout (TimeOutMS) will not immediately change the chart position.</div>
[[Category:Pre-built Signals]]