Hi there,
I have the following two lines of code that runs on the 15M chart.
Code: Select all
if MarketPosition (0) =-1 then BUYTOCOVER ("close sell") NEXT BAR OPEN at NEXT BAR LIMIT ;
BUY ("enter buy") MinList (NumContracts, max_contract) CONTRACT NEXT BAR OPEN at NEXT BAR+BuyLimit_Offset LIMIT ;
How can I rewrite these codes so that I can attach the strategy to the 1M chart while referencing the 15M chart's NEXT BAR OPEN at NEXT BAR LIMIT?
I would like to avoid the error of " Open Next Bar type strategies calculation is not permitted on multiple datastreams."
Thanks
MultiCharts calculates the signal at the end of the bar (EOB),
it then springs into action at the opening of next bar.
At EOB, you
do not know the opening value of the next bar,
that is why the calculation is not permitted.
This is the mechanical reality of a sequential process.
If you want to use the value of the opening in your calculation,
you have to WAIT until the OPEN has taken place.
ie. make your calculation after the first tick of the next bar.