Price reach limit order, but cannot close position  [SOLVED]

Questions about MultiCharts and user contributed studies.
kinwai
Posts: 89
Joined: 03 May 2019
Has thanked: 12 times
Been thanked: 1 time

Price reach limit order, but cannot close position

Postby kinwai » 21 May 2021

Hi all,

My strategy uses limit order to close position, I usually get the market price reach my limit order, but due to the market liquidity isn’t enough, finally cannot close my position.

May I check if anyone has idea to better tackle this situation?

eg. Does MC have function to detect this situation and use market order to close it?

kinwai
Posts: 89
Joined: 03 May 2019
Has thanked: 12 times
Been thanked: 1 time

Re: Price reach limit order, but cannot close position

Postby kinwai » 21 May 2021

Under this case, backtest report will indicate the position closed, but the actual is not.

kinwai
Posts: 89
Joined: 03 May 2019
Has thanked: 12 times
Been thanked: 1 time

Re: Price reach limit order, but cannot close position

Postby kinwai » 04 Jun 2021

Anyone can help?

masterchanger
Posts: 36
Joined: 03 Sep 2013
Location: Chicago, IL
Has thanked: 14 times
Been thanked: 12 times

Re: Price reach limit order, but cannot close position

Postby masterchanger » 07 Jun 2021

Hi,
I'm assuming you want to exit at the limit price and that a market exit is less desirable but not less desirable than a non-fill and the market may or may not return to your exit level.

Under Strategies properties-> Backtesting tab-Backtesting Assumptions, select fill limit order when trade price goes beyond limit price by 1 ticks.
That is a tougher requirement than backtesting and assuming a fill occurred just because it traded at your price.

As far as Auto Trading, you could select "convert unexecuted limit/stop exit orders to market orders after X seconds" to try and ensure your get out at some price.

Hope that helps!

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Price reach limit order, but cannot close position

Postby TJ » 07 Jun 2021

You have a situation.
You have to describe WHAT or HOW do you want to handle this situation.
There are millions of different ways . . . unless you can pinpoint a specific action, no one can help you.

Let me give you an example:

1. if the market came within X ticks of your price (say 2 ticks), start a counter variable (The Close Encounter)
2. if the market fills your order, cancel the counter variable
3. if the market moves away, the counter will keep track of the minutes since the last "Close Encounter".
4. if after Y minutes of the last close encounter, and your order is still not filled, convert the limit order to market order.

THere are still lots of specifics you need to work out, but this is a start to give you an idea on what you can do.

kinwai
Posts: 89
Joined: 03 May 2019
Has thanked: 12 times
Been thanked: 1 time

Re: Price reach limit order, but cannot close position

Postby kinwai » 11 Jun 2021

Hi TJ,

If I only use 1 min timeframe, how can I check X tick?

For this case, need to add one more data for tick?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Price reach limit order, but cannot close position  [SOLVED]

Postby TJ » 11 Jun 2021

You an use any time frame; it does not matter.
As soon as the market reached X ticks of your price, you can start a counter.

I would suggest you to engage a professional programmer to help you with your project.


Return to “MultiCharts”