|
|
Line 1: |
Line 1: |
| Trade strategies in MultiCharts .NET consist of one or several signals which are algorithms for order generation based on the analysis of price information on the chart.
| |
|
| |
|
|
| |
| For example, a strategy consists of one or more signals (algorithms) as shown in the chart below.
| |
|
| |
| http://www.multicharts.com/trading-software/images/b/bf/FormatObjects.png
| |
|
| |
| * Bollinger_Bands_LE signal is an algorithm of order generation for long position entry.
| |
| * Bollinger_Bands_SE signal is an algorithm of order generation for short position entry.
| |
| * Profit_Target signal is an algorithm of profit fixation.
| |
| * Stop_Loss is an algorithm protecting the position from a loss.
| |
|
| |
| A signal is able to generate orders in accordance with a built-in algorithm, which will be executed by the strategy.<br><br>
| |
| Signals have access to the information about the current condition and performance of a strategy.<br><br>
| |
| To add a strategy with one or several signals to a chart:
| |
| #right clink on the chart,
| |
| #select '''Insert Study''',
| |
| #select the '''Signals''' tab.<br><br>
| |
| After the strategy calculation you can see markers of orders executed by the strategy. A report upon the results of strategy calculation can be found in the '''View''' menu in the '''Strategy Performance Report'''.<br><br>
| |
| In MultiCharts .NET signals are objects of the class, inherited from ''SignalObject''.<br><br>
| |
| In the process of the signal calculation orders will be generated according to the algorithm as described in the '''CalcBar ()''' method. These orders will subsequently be executed by the strategy.<br><br>
| |
| Here is an example of a simple signal:
| |
|
| |
| <syntaxhighlight>
| |
| public class TestSignal : SignalObject
| |
| {
| |
| public TestSignal(object _ctx):base(_ctx){}
| |
|
| |
| // Declaring orders-objects
| |
| private IOrderMarket buy_order;
| |
|
| |
| protected override void Create() {
| |
| buy_order = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, EOrderAction.Buy));
| |
| }
| |
|
| |
| protected override void CalcBar(){
| |
| // Signal’s algorithm
| |
| //…………………………
| |
| //Order Generation
| |
| buy_order.Send();
| |
| }
| |
| }
| |
| </syntaxhighlight>
| |
|
| |
| [[Category:.NET Programming Giude]]
| |