Sometimes we define a Function, and pass parameters from Signal to Function. Moreover, Function return values to Signal. How can do these things? May you give some examples?
I find public ISeries<Double> price { get; set; }
public Int32 length { get; set; }
It seems these two get values from Signals.
protected override double CalcBar(){
if (Bars.CurrentBar == 1) return price.Value;
double prev = this[1];
return prev + m_smoothingfactor * (price.Value - prev);
}
this one will return values each time when it visit a bar.
what are ISeries<Double> and public Int32?
pass parameters from Signal to Function
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: pass parameters from Signal to Function
Hello viresearch,
ISeries is a base interface for functions, series variables, and price series. It provides access to historical values of inherited objects.
Please visit MSDN to learn about Int32
ISeries is a base interface for functions, series variables, and price series. It provides access to historical values of inherited objects.
Please visit MSDN to learn about Int32
-
- Posts: 12
- Joined: 21 Mar 2013
Re: pass parameters from Signal to Function
Now the problem is how to use Signal to call Function and pass parameters to them.
May you give me an example to use a Signal to call Function namespace PowerLanguage.Function
{ public class XAverageOrig : FunctionSeries<Double>
and how to pass parameters to public ISeries<Double> price { get; set; }
public Int32 length { get; set; }
May you give me an example to use a Signal to call Function namespace PowerLanguage.Function
{ public class XAverageOrig : FunctionSeries<Double>
and how to pass parameters to public ISeries<Double> price { get; set; }
public Int32 length { get; set; }
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: pass parameters from Signal to Function
viresearch, this is a general C# question, not related to MultiCharts .Net. Function, Signal and Indicator are abstract "forms" we have added for ease of use. The heart of any study in MC .Net is a class, like in regular C#. You can search the Internet to learn how it works and how to utilize it. You can also find code examples in the source code of the prebuilt MultiCharts studies (PowerLanguage .Net Editor->File tab->Open).