×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts
Open main menu

Changes

Basic Definitions

3,207 bytes added, 15:33, 29 April 2013
no edit summary
}
</syntaxhighlight>
 
==Signal/Strategy==
 
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>
 
==Inputs==
Inputs in MultiCharts .NET are user-defined options of the studies. Almost no indicators or signals exist without them. Inputs in PowerLanguage .Net are a public property of a study class, marked with an attribute ''[Input]''. There are different types of inputs: '''''int, double, string, DateTime, Color, Enum.'''''
 
 
An example of integral type input in the study:
<syntaxhighlight>
[Input]
public int length { get; set; }
</syntaxhighlight>
 
 
Now this input will be available in '''Format Study''' dialog on the '''Inputs''' tab under the name ''“length”''. Input values, chosen by the user in “Format Study” dialog, become available in the ''protected override void StartCalc()'' class study method.
Default values can be set in study constructor.<br>
'''Example:'''
 
A study has one adjustable double type parameter:
<syntaxhighlight>
public class Test : IndicatorObject {
public Test(object _ctx):base(_ctx) {
Percent = 10; // Default value
}
[Input]
public double Percent {get; set;}//Input in percent.
}
</syntaxhighlight>
 
[[Category:.NET Programming Giude]]