I am just doing some testing on if I can trade the same chart as a strategy runs. I have read some of the previous posts about "broker position" vs "market position". I am not using broker position information. But, I'm finding when submitting OCO orders the strategy is getting confused. In TS, this has worked for me without much issue but I don't use OCO orders. In testing, I am seeing a lot of problems with OCO orders, i.e. close a discretionary position and strategy goes flat.
The scenarios I want to accomplish are:
1. I submit OCO order. Strategy submits OCO order without conflicting. Assume same side and opposite side scenario.
2. Strategy submits OCO order and I manage it.
So, my questions are:
1. If I were not to use OCO orders on the strategy, would that resolve the conflicts? Is it possible to still display the strategy order in the chart for moving them?
2. Are there settings that will allow me to submit OCO orders from the chart trader while running strategy on same symbol without conflicting? In my testing, it appears it cannot determine which order closes position.
Trading same symbol/chart as strategy?
-
- Posts: 108
- Joined: 05 Mar 2014
- Has thanked: 1 time
- Been thanked: 12 times
- Svetlana MultiCharts
- Posts: 645
- Joined: 19 Oct 2017
- Has thanked: 3 times
- Been thanked: 163 times
Re: Trading same symbol/chart as strategy?
Hello tpredictor,
Technically it is possible to send manual orders on an auto trading chart, but the strategy “does not know” about the orders you place. Please refer to this article for more information.
Technically it is possible to send manual orders on an auto trading chart, but the strategy “does not know” about the orders you place. Please refer to this article for more information.
-
- Posts: 108
- Joined: 05 Mar 2014
- Has thanked: 1 time
- Been thanked: 12 times
Re: Trading same symbol/chart as strategy?
@svetalana Does it matter if I trade from the same chart as a strategy is running on or another chart in terms of the way the strategy will see the orders?
What I noticed in the sim, if strategy had 1 long and target/stop on. Now, I enter 1 more long manually. My OCO attached order is set to "2". Once I closed my order. I cannot cancel the limit order of strategy and positions did not match.
What would be the fix in this case? I have read the article but it is not clear to me. I will continue to experiment, as well. Is there anyway to cancel the strategy limit orders if I'm flat?
What I noticed in the sim, if strategy had 1 long and target/stop on. Now, I enter 1 more long manually. My OCO attached order is set to "2". Once I closed my order. I cannot cancel the limit order of strategy and positions did not match.
What would be the fix in this case? I have read the article but it is not clear to me. I will continue to experiment, as well. Is there anyway to cancel the strategy limit orders if I'm flat?
-
- Posts: 108
- Joined: 05 Mar 2014
- Has thanked: 1 time
- Been thanked: 12 times
Re: Trading same symbol/chart as strategy?
Also, I have a question if I trade multiple strategies from multiple charts will I still be able to use the strategy positions for position/account matching? Is that the idea behind the strategy order add-on?
- Svetlana MultiCharts
- Posts: 645
- Joined: 19 Oct 2017
- Has thanked: 3 times
- Been thanked: 163 times
Re: Trading same symbol/chart as strategy?
No, it does not.Does it matter if I trade from the same chart as a strategy is running on or another chart in terms of the way the strategy will see the orders?
Price orders are valid at broker while they are sent by the strategy. That means the conditions for order generation should be met in your code on each bar close or each tick (if IOG=ON) calculation while you need to keep your orders active. If you want to cancel an order, the conditions for order generation shall be invalid.Is there anyway to cancel the strategy limit orders if I'm flat?
You can refer to Strategy Positions tab of Order and Position Tracker.Also, I have a question if I trade multiple strategies from multiple charts will I still be able to use the strategy positions for position/account matching? Is that the idea behind the strategy order add-on?
If you want to track the strategy position from your code, please refer to the help for MarketPosition_at_Broker_for_The_Strategy keyword. Help is available in PowerLanguage Editor –> right click the keyword and press F1.