Hi,
I am trying to use the automated trading with multicharts and interactive brokers. I initiated the automated trading and it initiated a short position. I like to know, while it was holding on to the short position and I turned off the software after market close. How do I re-initiate the positions the next day with the same open position with the same strategy?
Regards,
Ken
Automated Trading
- Stan Bokov
- Posts: 963
- Joined: 18 Dec 2009
- Has thanked: 367 times
- Been thanked: 302 times
Re: Automated Trading
Dear Ken,
You can enable the 'Show the Assign the Initial Market Position at the Broker dialogue' - 'Show always' in Strategy Properties --> Auto Trading.
Thus, you can set the position, you are currently in, every time you turn on the auto trading.
You can enable the 'Show the Assign the Initial Market Position at the Broker dialogue' - 'Show always' in Strategy Properties --> Auto Trading.
Thus, you can set the position, you are currently in, every time you turn on the auto trading.
Re: Automated Trading
Thanks Stan,
You alway come to my rescue. But will the system manage the positions it initiated in the last session and trade accordingly? Or will it start afresh?
For example, in my code has something like this:
If Marketposition = 0 then
begin
xxxx xxxx xxxx xxxx;
end;
If Marketposition > 0 then
begin
yyyy yyyy yyyy yyyy;
end;
If I have long positions before I initiate it, will it do x or y?
You alway come to my rescue. But will the system manage the positions it initiated in the last session and trade accordingly? Or will it start afresh?
For example, in my code has something like this:
If Marketposition = 0 then
begin
xxxx xxxx xxxx xxxx;
end;
If Marketposition > 0 then
begin
yyyy yyyy yyyy yyyy;
end;
If I have long positions before I initiate it, will it do x or y?
- Stan Bokov
- Posts: 963
- Joined: 18 Dec 2009
- Has thanked: 367 times
- Been thanked: 302 times
Re: Automated Trading
Dear Ken,
Thanks for the kind words. The MarketPosition word refers to the position on your chart, while MarketPosition_at_Broker actually reaches out to the broker and grabs the position from there.
With code such as "If MarketPosition = 0" your signal will read off your chart, and act accordingly. You can either have it start 'afresh' by assigning an initial flat position, or you can have it pick up somewhere else by specifying either a long or short position when you turn on AT.
If you use AA trading mode, it should be easy to see where you left off last session.
Thanks for the kind words. The MarketPosition word refers to the position on your chart, while MarketPosition_at_Broker actually reaches out to the broker and grabs the position from there.
With code such as "If MarketPosition = 0" your signal will read off your chart, and act accordingly. You can either have it start 'afresh' by assigning an initial flat position, or you can have it pick up somewhere else by specifying either a long or short position when you turn on AT.
If you use AA trading mode, it should be easy to see where you left off last session.
Re: Automated Trading
Hi Stan,
I am using marketposition in my strategy rather than marketposition_at_broker because I may run 2 sets of strategies in the same instrument. And if it is using marketposition_at_broker rather than marketposition, ithe strategies may trade based on my total positions rather than acting independently.
So if I read your explaination correctly, the strategy will not start afresh if I assign the previous open position if I assign the position number when I start AT mode.
Am I correct?
Regards,
Ken
I am using marketposition in my strategy rather than marketposition_at_broker because I may run 2 sets of strategies in the same instrument. And if it is using marketposition_at_broker rather than marketposition, ithe strategies may trade based on my total positions rather than acting independently.
So if I read your explaination correctly, the strategy will not start afresh if I assign the previous open position if I assign the position number when I start AT mode.
Am I correct?
Regards,
Ken
- Stan Bokov
- Posts: 963
- Joined: 18 Dec 2009
- Has thanked: 367 times
- Been thanked: 302 times
Re: Automated Trading
Let's get on the same page, could you define the word 'afresh'? Actually, if you could clearly define what you want to do, I can tell you if this feature will do that.
Re: Automated Trading
Assume that my strategy has some leftover positions. For example, it has 5 long open positions in my last session before I stop the automated trading. I want to resume the automated trading and I want the automated trading to continue to manage the 5 long open positions that it has from the previous trading session, will it start trading with the assumption that it has 5 long open positions or it will assume that it has no position (start afresh)?
Regards,
Ken
Regards,
Ken
- Stan Bokov
- Posts: 963
- Joined: 18 Dec 2009
- Has thanked: 367 times
- Been thanked: 302 times
Re: Automated Trading
Dear Ken,
Thank you for the clear explanation. This feature will do what you want - manage the leftover positions. Once you turn on autotrading, with "assign initial position" turned on, you will see a windows that will automatically suggest how much you have already open. I will probably say on a given chart - you have a long position with 5 contracts, accept? If you click yes, your strategy will be turned on and take into account that you are currently long 5.
Thank you for the clear explanation. This feature will do what you want - manage the leftover positions. Once you turn on autotrading, with "assign initial position" turned on, you will see a windows that will automatically suggest how much you have already open. I will probably say on a given chart - you have a long position with 5 contracts, accept? If you click yes, your strategy will be turned on and take into account that you are currently long 5.