IntrabarOrderGeneration=True & buy next bar at inside limit  [SOLVED]

Questions about MultiCharts and user contributed studies.
maisatomai
Posts: 83
Joined: 18 Mar 2013
Has thanked: 11 times

IntrabarOrderGeneration=True & buy next bar at inside limit

Postby maisatomai » 23 Oct 2014

On a 5min bar chart, there is no signal in the first minute.
But in 2nd minute, a signal appear and I would want to trade on the signal immediately.

Now I am using this code

Code: Select all

buy next bar at inside limit
However, this code will only buy on next bar open. Is there a way to

Code: Select all

buy this bar at inside limit?

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

Re: IntrabarOrderGeneration=True & buy next bar at inside li

Postby TJ » 23 Oct 2014

On a 5min bar chart, there is no signal in the first minute.
But in 2nd minute, a signal appear and I would want to trade on the signal immediately.
Now I am using this code

Code: Select all

buy next bar at inside limit
However, this code will only buy on next bar open. Is there a way to

Code: Select all

buy this bar at inside limit?
If you want a fill immediately, you have to use MARKET order.

If you use LIMIT, the only time you get fill is when the price traded through your LIMIT.

maisatomai
Posts: 83
Joined: 18 Mar 2013
Has thanked: 11 times

Re: IntrabarOrderGeneration=True & buy next bar at inside li

Postby maisatomai » 23 Oct 2014

sorry for not being clear. I know what is a limit and what is a buy.

Let say I would like to place a 100 limit buy if the price touch 102.

Code: Select all

if (currentprice<=102) then
buy next bar at 100 limit
1st min: 107
2nd min: 102
3rd min:99.9

On the 2nd minute, MC will not place the 100 limit buy immediately. It will place only at the 5th minute. I want MC to place the 100 limit buy on the 2nd minute as the condition is met on the 2nd minute. My question is how do I do this? I want to do something like

Code: Select all

buy immediately at 100 limit
This example is not real as I have some proprietary code that do something like this and I cannot post on this forum.

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

Re: IntrabarOrderGeneration=True & buy next bar at inside li

Postby TJ » 23 Oct 2014

sorry for not being clear. I know what is a limit and what is a buy.
Let say I would like to place a 100 limit buy if the price touch 102.

Code: Select all

if (currentprice<=102) then
buy next bar at 100 limit
1st min: 107
2nd min: 102
3rd min:99.9
On the 2nd minute, MC will not place the 100 limit buy immediately. It will place only at the 5th minute. I want MC to place the 100 limit buy on the 2nd minute as the condition is met on the 2nd minute. My question is how do I do this? I want to do something like

Code: Select all

buy immediately at 100 limit
This example is not real as I have some proprietary code that do something like this and I cannot post on this forum.
Your thread subject says "IntrabarOrderGeneration=True",
have you added this line in your code?

If so, then MultiCharts will trigger the order intrabar as soon as the condition is met, even though the EasyLanguage syntax says "BUY NEXT BAR".

maisatomai
Posts: 83
Joined: 18 Mar 2013
Has thanked: 11 times

Re: IntrabarOrderGeneration=True & buy next bar at inside li

Postby maisatomai » 23 Oct 2014

Maybe I check it again tomorrow when the market is open. I understand what you mean and I thought MC will do what you have described. But I experienced otherwise. Thanks.

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

Re: IntrabarOrderGeneration=True & buy next bar at inside li  [SOLVED]

Postby TJ » 23 Oct 2014

Maybe I check it again tomorrow when the market is open. I understand what you mean and I thought MC will do what you have described. But I experienced otherwise. Thanks.
Bear in mind that the order will be in effect so long as the "Condition" is met.
If the condition is no longer true, the order will be cancelled.


Return to “MultiCharts”