Hi,
I am trying to implement a dynamic stop order, i.e. the stop price will be recalculated on every bar, and is not a fixed points away or a fixed percentage, hence cannot be a simple trailing stop.
I see two logical approaches, with MultiCharts connecting to IB TWS, and am wondering which is possible.
1) Send a stop order over to IB TWS, let it sit on TWS server side, and modify the stop price on each new bar. Is this possible? I don't see an order reference for Easy Language, is this even possible?
2) Create a new stop order on each bar
I am a newbie and I might be totally wrong here, in assuming an order can last more than a bar?
Thanks for any advice!
Dynamic stop
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: Dynamic stop
TJ posted this in another section but it may help you also.
Order Types :
https://www.multicharts.com/trading-sof ... ders&go=Go
https://www.multicharts.com/trading-sof ... rder_Types
You can do searches there for specific order types ..
Order Types :
https://www.multicharts.com/trading-sof ... ders&go=Go
https://www.multicharts.com/trading-sof ... rder_Types
You can do searches there for specific order types ..
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Dynamic stop
Hello Ivanyu,
- Any stop order placed to IB broker is sent directly to their end.
- In order to maintain the order, conditions for order generation should met in script on every calculation, otherwise it is cancelled.
- IB broker supports order modification what means that if order parameters are changed, it will be modified (not cancelled and replaced).
Re: Dynamic stop
Say current market price is 1000, and I sent a "buy next bar stop 1100"
and if it happens that the market never reaches 1100 in the next bar
then what happens to my stop order? cancelled at the end of bar? or still remain live on IB?
If still remain live, then how do I modify it from Easy Language side?
and if it happens that the market never reaches 1100 in the next bar
then what happens to my stop order? cancelled at the end of bar? or still remain live on IB?
If still remain live, then how do I modify it from Easy Language side?
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Dynamic stop
As long as conditions for this order generation are met on each strategy calculation, the orders stays active. if you wan t to cancel it, the conditions for the order generation should not be met in script calculation any longer.
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Dynamic stop
MC doesn't keep orders on its end in terms of IB broker, all orders are sent directly to broker. If your script sends order at next bar, the order will placed. If on next script calculation it still generate the same order to be placed at open of next bar, the order is maintained. If the script does not generate the same order on next calculation, the order pending at broker is cancelled.
-
- Posts: 14
- Joined: 28 Jan 2022
- Has thanked: 6 times
Re: Dynamic stop
Do you have any sample PowerLanguage code that I can use to make my own dynamic stop?