pattern  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
alex625144
Posts: 2
Joined: 02 Oct 2012
Has thanked: 1 time

pattern

Postby alex625144 » 02 Oct 2012

Hi.
Please tell me how to write a sample code to test the patterns strategy in mc.net

Example
if(Bars.Close[0]<Bars.Close[1] && Bars.Close[1]<Bars.Close[2])
m_Order0.Send

Thank you.

User avatar
Henry MultiСharts
Posts: 8513
Joined: 25 Aug 2011
Has thanked: 1213 times
Been thanked: 2733 times

Re: pattern

Postby Henry MultiСharts » 03 Oct 2012

Hello alex625144,

There are multiple prebuilt strategy codes in MultiCharts .Net editor already.
Please describe your final goal in details.
These users thanked the author Henry MultiСharts for the post:
alex625144

alex625144
Posts: 2
Joined: 02 Oct 2012
Has thanked: 1 time

Re: pattern

Postby alex625144 » 03 Oct 2012

I want backtest next strategy:
if (close[-1]>close[-2]<close[-3]<close[-4])
buy at market
sell through one bar


I looked at all the examples of strategies in the standard library, but such is not found. Or please specify the name of such a strategy in the standard library.
Thank you.

User avatar
Henry MultiСharts
Posts: 8513
Joined: 25 Aug 2011
Has thanked: 1213 times
Been thanked: 2733 times

Re: pattern  [SOLVED]

Postby Henry MultiСharts » 04 Oct 2012

You can reference previous bars values like that:

Code: Select all

Bars.Close[1]>Bars.Close[2]


Return to “MultiCharts .NET”