Portfolio - This bar at close vs next bar at open  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Portfolio - This bar at close vs next bar at open

Postby joebone » 07 Jan 2022

Hello,

Just a quick question.
I am building a portfolio Rotation Tool and I wanted see if this logic checked out with someone who knew.

If I use This bar at close to sell positions and Next bar at open to Buy positions will the sell orders clear the backtester before the buy orders come in? allowing for new positions with the newly available capital or are all orders calculated at close of bar regardless of fill time?

User avatar
Tammy MultiCharts
Posts: 200
Joined: 06 Aug 2020
Has thanked: 6 times
Been thanked: 65 times

Re: Portfolio - This bar at close vs next bar at open

Postby Tammy MultiCharts » 11 Jan 2022

Hello joebone,

If you are using buy next bar at open, the order will be generated on the Close of the bar and sent on the Open of the next bar.

As far as sell short this bar at close, please note that "this bar at close" orders are generally used for backtesting. In live trading the orders will not be sent on this bar close, instead, they will be sent on the next tick.

Here's an extract about that from EasyLanguage Essentials Programmers Guide:
This bar on Close: Market order on the close of this bar, generally used for historical backtesting purposes only. This will not generate a market on close order.

>will the sell orders clear the backtester before the buy orders come in
This can happen in the ideal world if the orders are filled with 1 tick difference.
However, most likely the Sell and Buy orders will interfere in live trading and one of them will be cancelled.
To ensure the position is closed before the entry we would recommend to use "sell next bar market" and send a limit entry order guaranteed to be executed.
You can try using this expression:

Code: Select all

Buy next bar at High * 1.02 Limit

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: Portfolio - This bar at close vs next bar at open  [SOLVED]

Postby joebone » 11 Jan 2022

Thanks for the explanation


Return to “MultiCharts”