Dynamic stop

Questions about MultiCharts and user contributed studies.
ivanyu
Posts: 31
Joined: 24 Jul 2013
Has thanked: 3 times
Been thanked: 1 time

Dynamic stop

Postby ivanyu » 17 Aug 2013

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!

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: Dynamic stop

Postby sptrader » 18 Aug 2013

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 ..

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Dynamic stop

Postby Andrew MultiCharts » 19 Aug 2013

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).

ivanyu
Posts: 31
Joined: 24 Jul 2013
Has thanked: 3 times
Been thanked: 1 time

Re: Dynamic stop

Postby ivanyu » 19 Aug 2013

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?

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Dynamic stop

Postby Andrew MultiCharts » 19 Aug 2013

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.

ivanyu
Posts: 31
Joined: 24 Jul 2013
Has thanked: 3 times
Been thanked: 1 time

Re: Dynamic stop

Postby ivanyu » 19 Aug 2013

you mean multicharts will implicitly keep or cancel such stop order?

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Dynamic stop

Postby Andrew MultiCharts » 19 Aug 2013

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.

altoncrooks
Posts: 14
Joined: 28 Jan 2022
Has thanked: 6 times

Re: Dynamic stop

Postby altoncrooks » 11 Mar 2022

Do you have any sample PowerLanguage code that I can use to make my own dynamic stop?


Return to “MultiCharts”