intrabarordergeneration behaviour

Questions about MultiCharts and user contributed studies.
Erik Pepping
Posts: 66
Joined: 25 Aug 2007
Been thanked: 4 times

intrabarordergeneration behaviour

Postby Erik Pepping » 05 May 2009

I have [IntraBarOrderGeneration=True] in my Stratgy. I log my trades also to a file. Although multicharts puts the Sell and ButTocover when I exit a trade at the end of the bar the condition that is met is met anyway, so many files are written, almost with evey tick. How can i test that the real SELL is given at the end of the bar without changing the IntraBarOrderGeneration to false.
Entires are truly intrabar, but exists seem to be always at the end or close of the bar.

My code is something like this:
if (condition=true) then
begin
Sell ("Sell") this bar;
if LastbarOnchart() then
FileAppend("C:\temp\sell" + Numtostr(currenttime,0);
end

SUPER
Posts: 622
Joined: 03 Mar 2007
Has thanked: 99 times
Been thanked: 80 times

Postby SUPER » 06 May 2009

Code: Select all

Entires are truly intrabar, but exists seem to be always at the end or close of the bar.


try following code to sell next bar at market, in IOB enabled strategies, next bar at market is treated as next tick so when ever your condition becomes true it will sell at next tick.

My code is something like this:
if (condition=true) then
begin
Sell ("Sell") next bar at Market;
if LastbarOnchart() then
FileAppend("C:\temp\sell" + Numtostr(currenttime,0);
end;[/code]


Return to “MultiCharts”