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
problem generation order intrabar
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: problem generation order intrabar
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.
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.
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: problem generation order intrabar
try thisI 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
Code: Select all
[IntrabarOrderGeneration = True];
if marketposition=0 and (high>high[1]) and (close<open) then sellshort ("Sell") next bar at market ;
Re: problem generation order intrabar
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)
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)
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: problem generation order intrabar
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
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