problem generation order intrabar

Questions about MultiCharts and user contributed studies.
turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

problem generation order intrabar

Postby turbofib » 14 May 2013

I can not generate orders long or short before the close of the candle .... what is wrong in

[IntrabarOrderGeneration = True];
if marketposition=0 and (high>high[1]) and (close<open) then sellshort ("Sell") next bar at open ;


This statement makes me start the Sell to a close of the candle .


I want to get it started as soon as the condition close <open occurs ... how to do?
(so I can 'get short in the middle of the candle)


thenks

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: problem generation order intrabar

Postby Dave Masalov » 14 May 2013

Hello turbofib,

Are you referring to the real-time calculation or backtesting? In real-time calculation your code should generate orders in the middle of the bar (on the next tick) if the condition is met.

However, in baktesting mode the script is calculated only 4 times per bar (on Open, High, Low and close) in Intra-Bar Order Generation mode. This might be the case with the behavior that you described.

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

Re: problem generation order intrabar

Postby TJ » 14 May 2013

I can not generate orders long or short before the close of the candle .... what is wrong in
[IntrabarOrderGeneration = True];
if marketposition=0 and (high>high[1]) and (close<open) then sellshort ("Sell") next bar at open ;
This statement makes me start the Sell to a close of the candle .
I want to get it started as soon as the condition close <open occurs ... how to do?
(so I can 'get short in the middle of the candle)
thenks
try this

Code: Select all

[IntrabarOrderGeneration = True];
if marketposition=0 and (high>high[1]) and (close<open) then sellshort ("Sell") next bar at market ;

turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

Re: problem generation order intrabar

Postby turbofib » 14 May 2013

yes is backtesting...
but how do I know in the historic goodness of a system if he even calculates differently entry and exit trading signals?
(with then sellshort ("Sell") next bar at market is same result)

turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

Re: problem generation order intrabar

Postby turbofib » 14 May 2013

is possibile include in next version multichart the real-time calculation in backtesting?

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: problem generation order intrabar

Postby Dave Masalov » 15 May 2013

turbofib,

Please read the following MC Wiki article on differences between backtesting and live trading and different backtesting options: https://www.multicharts.com/trading-sof ... ve_Trading


Return to “MultiCharts”