Limit Order  [SOLVED]

Questions about MultiCharts and user contributed studies.
shadrock55
Posts: 51
Joined: 24 Feb 2011
Location: Atlanta, GA
Has thanked: 5 times
Been thanked: 8 times

Limit Order

Postby shadrock55 » 21 Aug 2014

I am using a limit order to buy at a price lower than the current price. I don't actually want it to act like a limit order though. I want it to change to a market order at that price and execute immediately so that the order doesn't wait in line. What is this best way to do that?

I thought I could do this is in the strategy properties by enabling:

"Convert Unexecuted limit/stop orders to market orders after 0 seconds"

in the autotrading strategy properties section, but I think that is cancelling the order before it can get hit. If that is right, is it that I have the auto setting of:

"Cancel market orders as obsolete if not filled within 0 seconds"? Should it be higher than zero? I really think it should be it was the default.

I am using a CQG Demo account to do this.

Example: Price is currently 1992.00, and I want to buy if the price drops to 1991.00.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Limit Order

Postby Henry MultiСharts » 22 Aug 2014

Hello shadrock55,

The best way is to explicitly write in your code:
if close=1991.00 then buy next bar at market.

As for the Auto Trading options - there is no option that will work exactly like you want. They are designed for different purposes. Please study the descriptions and examples in the corresponding article: Auto Trading

shadrock55
Posts: 51
Joined: 24 Feb 2011
Location: Atlanta, GA
Has thanked: 5 times
Been thanked: 8 times

Re: Limit Order

Postby shadrock55 » 22 Aug 2014

I'm assuming you mean turn on intrabar order generation and use that statement, right? Otherwise, it will hardly ever execute... or did the response go completely over my head?

The problem is that I can never get the code to match using IOG. If you are saying that I should be able to replicate the backtest result to sim test result exactly using IOG, then I'll keep messing with it assume that I simply haven't written the code right.

Also, the "Accounts" tab on the "Orders and Position Tracker Window" is completely empty for the demo account. Everything else in the "Orders and Position Tracker Window" works properly. MC 9.0 Beta 2. CQG Demo Account.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Limit Order  [SOLVED]

Postby Henry MultiСharts » 22 Aug 2014

I'm assuming you mean turn on intrabar order generation and use that statement, right? Otherwise, it will hardly ever execute... or did the response go completely over my head?
That is correct.
The problem is that I can never get the code to match using IOG.
If the market is moving fast then it is possible that you won't be filled at exact specified price. The broker determines the fill price of the market order, not the user. If you want your order to be filled at specified price - you need to use price orders (limit, stop, stop limit).
Also, the "Accounts" tab on the "Orders and Position Tracker Window" is completely empty for the demo account. Everything else in the "Orders and Position Tracker Window" works properly. MC 9.0 Beta 2. CQG Demo Account.
If you have an accont number in the DOM window/Chart Trading Panel/Trade bar then it should also be present in the Order and Position Tracker window. Please try scrolling up the window.

shadrock55
Posts: 51
Joined: 24 Feb 2011
Location: Atlanta, GA
Has thanked: 5 times
Been thanked: 8 times

Re: Limit Order

Postby shadrock55 » 22 Aug 2014

Thanks. I expect slippage, but code using IOG simply goes off at the wrong place. I'll mess with it this weekend, since you are implying that it should be an exact match +/- slippage.

I scrolled up, and I feel dumber for it since its there.....

Thanks

User avatar
Smoky
Posts: 507
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 97 times
Been thanked: 115 times

Re: Limit Order

Postby Smoky » 10 Sep 2014

Hello shadrock55,

The best way is to explicitly write in your code:
if close=1991.00 then buy next bar at market.

As for the Auto Trading options - there is no option that will work exactly like you want. They are designed for different purposes. Please study the descriptions and examples in the corresponding article: Auto Trading
Sorry Henry ;) i'm not agree with your workaround !

- with Market order we have slippage and spread !
- with limit order we are on the book, no slippage and we make liquidity on market and best brokers give you the spread ! shadrock55 is right, it's the best order for trader !

For example :
In strong uptrend, we can use shadrock55 buy limit orders to pyramid and take all small returns with spread for us ! max wins, better than market orders ....

Hope to have this with 9.1 ;)


Return to “MultiCharts”