limit order

Questions about MultiCharts and user contributed studies.
stonebrook2011
Posts: 11
Joined: 30 Dec 2011
Has thanked: 1 time

limit order

Postby stonebrook2011 » 02 Mar 2013

Hi,
I have an easy question. For example, I have two signals A and B

A:

Code: Select all

condition1 = CurrentBar > 1 and var0 crosses over var1 ;
if condition1 then
Buy ( "MA2CrossLE" ) next bar at close limit;
B:

Code: Select all

condition1 = CurrentBar > 1 and var0 > var1 ;
if condition1 then
Buy ( "MA2CrossLE" ) next bar at close limit;

For signal A, if limit order is not filled, the order will be cancelled at the end of "next bar", and no orders will be generated until signal A becomes true again.

For signal B, I am wondering what will happen if limit order is not filled in the "next bar"? (assume I don't want to change to market order).

My thought is, for signal B, if limit order is not filled, the order will be cancelled at the end of "next bar". And because signal B remains true, so a new limit order will be generated several seconds later in the next bar of "next bar" with a NEW limit price of previous close price until a limit order is filled or signal B becomes false.

Am I right? Or this limit order will remain unchanged and won't be replaced by new limit orders with new limit price?

I can test on Monday, but some input here will help me if I run into some confusion.

Thanks a lot
Last edited by stonebrook2011 on 02 Mar 2013, edited 1 time in total.

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

Re: limit order

Postby TJ » 02 Mar 2013

you can test your code with InteractiveBrokers' demo system. It is free and does not require registration.



ps. How to post codes:
viewtopic.php?f=16&t=11713


Return to “MultiCharts”