Synch and Auto Trading
Synch and Auto Trading
I was thinking of using the feature Assume the initial market position at the broker the SAME AS on the CHART to synch with the actual position at the broker after restarting MC. I'm not too clear on how this works. I presume one first has to generate the signal on the chart at the same entry price that the original real order was filled. I can't see how one can do this after restarting MC, assuming the entry level is known. Is there a way? I already save the average entry level, number of contracts and direction (long or short) of the latest open positions into a file, and my study currently reads these details each time I start MC and displays them in a Windows MessageBox so I can type in the appropriate values in the Broker dialogue. If there is no way for a study to place a signal at the appropriate location on the chart, I will have to keep using the other approach of Assigning the Initial Market Position at the Broker dialogue -> Show always This works fine except I have to enter the numbers manually each time, which is what I'm trying to avoid.
- Stan Bokov
- Posts: 963
- Joined: 18 Dec 2009
- Has thanked: 367 times
- Been thanked: 302 times
Re: Synch and Auto Trading
The assign initial market position will always be manual, even though it provides a guess as to what the current position is.
It would make more sense to me to use built-in features for syncing, such as the two signals included in MC, called "!From Broker to Strategy MP Synchronizer!" and "!From Strategy to Broekr MP Synchronizer!".
You can write into your signals a check regarding MarketPosition_at_Broker and use the ChangeMarketPosition keyword to change the market position accordingly.
It would make more sense to me to use built-in features for syncing, such as the two signals included in MC, called "!From Broker to Strategy MP Synchronizer!" and "!From Strategy to Broekr MP Synchronizer!".
You can write into your signals a check regarding MarketPosition_at_Broker and use the ChangeMarketPosition keyword to change the market position accordingly.
Re: Synch and Auto Trading
That's what I will do; when the final release of MC7 is done. I've already coded most of the work in MC6, and it works fine in off-line mode by faking a signal using a normal order. Does ChangeMarketPosition work both off-line and on-line, or just on-line? If it works off-line too, I will use it in place of a normal order.You can write into your signals a check regarding MarketPosition_at_Broker and use the ChangeMarketPosition keyword to change the market position accordingly.
- Stan Bokov
- Posts: 963
- Joined: 18 Dec 2009
- Has thanked: 367 times
- Been thanked: 302 times
Re: Synch and Auto Trading
It simulates an order sent to the broker - it makes it on the chart, changes the market position, but doesn't send it anywhere. Works regardless of whether autotrading is off or on.