Change orders for strategy breakout  [SOLVED]

Questions about MultiCharts and user contributed studies.
tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

Change orders for strategy breakout

Postby tradingest » 29 Oct 2016

Hi all,

I can change orders for my strategy breakout? It's possible change orders from stop order at limit order? For a trategy breakout could be valid?

That's for riduce slippage in my breakout strategy if possible or exist some way.

Your advices?

tradingest

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Change orders for strategy breakout

Postby JoshM » 29 Oct 2016

I can change orders for my strategy breakout? It's possible change orders from stop order at limit order? For a trategy breakout could be valid?

That's for riduce slippage in my breakout strategy if possible or exist some way.
Once an order is submitted, you can change its price but not its type. So you can change the price of a pending limit order, but not transforming an open limit order into a stop order (or vice versa).

Instead, you'll first need to cancel the existing order and then submit the other order type.

tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

Re: Change orders for strategy breakout

Postby tradingest » 29 Oct 2016

I don't understand...can you explain with example or other words?

thanks

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Change orders for strategy breakout

Postby JoshM » 29 Oct 2016

I don't understand...can you explain with example or other words?
What's unclear? I'm not sure if I can put it much differently.

The following order modification is possible in MultiCharts:
- Adjusting the order's price
- Changing the quantity of the order
- Cancelling an order

What is not possible is:

- Converting a pending limit order into a stop order, or converting an open stop order into a limit order.

Instead, if you want to change an open stop order into an open limit order, then you'll first cancel the open stop order and then submit the new limit order. Otherwise, if you don't cancel the open stop order, it remains active and can open an unwanted position later.

- - -

I now realise that you didn't ask specifically about changing open orders, but for this reply I'll assume that you did because using a stop order instead of a limit order is clicking another button.

tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

Re: Change orders for strategy breakout

Postby tradingest » 29 Oct 2016

The following order modification is possible in MultiCharts:
- Adjusting the order's price
- Changing the quantity of the order
- Cancelling an order
How I can make it?
It's possible have a example code for 3 cases listed above?

Currently I use

Code: Select all

If CurrentBid < H and CurrentBid > H - (1*bigpointvalue)
Then Begin
Buy N contract next bar at H stop;
End;
I can put a superior limit and the price is very far from the desired price the order is not executed or something like that?

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Change orders for strategy breakout

Postby JoshM » 30 Oct 2016

The following order modification is possible in MultiCharts:
- Adjusting the order's price
- Changing the quantity of the order
- Cancelling an order
How I can make it? It's possible have a example code for 3 cases listed above?

Currently I use

Code: Select all

If CurrentBid < H and CurrentBid > H - (1*bigpointvalue)
Then Begin
Buy N contract next bar at H stop;
End;
To change the order price, you simply change the `at H stop` part of your example to something else (like `at value1 stop`, `at H[1] stop`, or `at myCustomVariable stop`).

To change the order quantity, you simply change the value of the `N` variable to something else (like `Buy N * 2 contracts`).

And to cancel the stop order of your above code example, you'll need to stop submitting it. In this case, that means your if statement condition has to become `false`. So whenever the current bid isn't around the bar's high anymore, the stop order is cancelled (since the if statement's condition is invalidated).

tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

Re: Change orders for strategy breakout

Postby tradingest » 30 Oct 2016

easily I can write to cancel the order with code below:

Code: Select all

CurrentAsk - CurrentBid < 1.0
It's correct? Can be one of the many solutions?

because the slippage often is due to too much spread

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Change orders for strategy breakout

Postby JoshM » 30 Oct 2016

easily I can write to cancel the order with code below:

Code: Select all

CurrentAsk - CurrentBid < 1.0
It's correct? Can be one of the many solutions?
This can be a solution, that's true.

But we cannot answer for you whether this is correct, because that depends on your goals and how you want your strategy to behave.

If you want your strategy to cancel pending stop orders when the slippage is 1 or more, then it works. But do note that an if statement that uses this condition will also resubmit that stop order when the slippage is less than 1.

Depending on how the instrument trades, that can mean the stop order is cancelled, resubmitted, cancelled, resubmitted, cancelled, .. and so on.

tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

Re: Change orders for strategy breakout  [SOLVED]

Postby tradingest » 30 Oct 2016

If you want your strategy to cancel pending stop orders when the slippage is 1 or more, then it works. But do note that an if statement that uses this condition will also resubmit that stop order when the slippage is less than 1
If the spread return < 1 it's correct that strategy resubmit the order only if the price < H for breakout long.
Otherwise the order will not be resubmit. The condition Currentbid < H allow me to avoid the price is very far from target price breakout


Return to “MultiCharts”