From Broker To Strategy MP Synchronizer: Difference between revisions
From MultiCharts
From Broker To Strategy MP Synchronizer (view source)
Revision as of 15:15, 14 September 2021
, 14 September 2021no edit summary
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
<br> | <br> | ||
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. | 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. The price of the synchronizing order is equal to [[AvgEntryPrice_at_Broker]]. | ||
=== How to choose timeouts === | === How to choose timeouts === | ||
1) Use [[Print]] statement in your script to output computer time in ms and three market positions: | 1) Use [[Print]] statement in your script to output computer time in ms and three market positions: | ||
([[MarketPosition]], [[MarketPosition_at_Broker]], [[ | ([[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. | 2) Use Print statement in your script to output computer time in milliseconds and the fact of execution of ChangeMarketPosition command. | ||