Buy OnOpen Sell OnClose

Questions about MultiCharts and user contributed studies.
green7
Posts: 2
Joined: 06 Aug 2014

Buy OnOpen Sell OnClose

Postby green7 » 06 Aug 2014

I want to backtest simple strategy:

- D1 bars
- depending the conditions: I want to buy on the next bar Open and sell on the bar Close.

How to achieve it ?

Regards

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Buy OnOpen Sell OnClose

Postby Henry MultiСharts » 06 Aug 2014

Hello green7,

"Next bar Open" and "this bar Close" cannot be combined in a single signal.
Therefore you need to create two individual signals and apply them to the same chart:

Code: Select all

if marketposition=0 then buy next bar at open next bar limit;

Code: Select all

if marketposition=1 then sell this bar on close;

green7
Posts: 2
Joined: 06 Aug 2014

Re: Buy OnOpen Sell OnClose

Postby green7 » 07 Aug 2014

Hello green7,

"Next bar Open" and "this bar Close" cannot be combined in a single signal.
Therefore you need to create two individual signals and apply them to the same chart:

Code: Select all

if marketposition=0 then buy next bar at open next bar limit;

Code: Select all

if marketposition=1 then sell this bar on close;
Of course I want to close on next bar Close.
Could you give me small hint how to make this in MC.NET strategy ?

Regards

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Buy OnOpen Sell OnClose

Postby Henry MultiСharts » 07 Aug 2014

Of course I want to close on next bar Close.
Could you give me small hint how to make this in MC.NET strategy ?
Please see CalcAtOpenNextBarAttribute in 4.6.6_Calculation_per_Bar and the prebuilt Volty_Expan_Open_LE signal.
For exit - MarketThisBar in 4.6.1_Orders.


Return to “MultiCharts”