C# Class NinjaTrader.Indicator.EncogFrameworkIndicator

Inheritance: Indicator
Exibir arquivo Open project: filgood/encog-financial Class Usage Examples

Private Properties

Property Type Description
ParseArraySize void

Public Methods

Method Description
DrawError ( ) : void
WaitForPacket ( ) : void

Wait for a packet. Timeout if necessary.

Protected Methods

Method Description
Eval ( string str ) : IDataSeries

Evaluate a custom indicator. These indicators must be in the form: INDICATOR.VALUE[BARS_NEEDED] For example, MACD(12,26,9).Avg[1] This would request the current BAR of the Avg value of the MACD indicator. If the indicator has only one value, then the following format is used. EMA(14)[1] This would request the current bar of EMA, with a period of 14.

FillParams ( MethodInfo targetMethod, IList paramList ) : object[]

Fill the parameters of a 3rd party indicator.

GotPacket ( String line ) : void

Process a packet.

Initialize ( ) : void

This method is used to configure the indicator and is called once before any bar data is loaded.

OnBarUpdate ( ) : void

Called on each bar update event (incoming tick)

OnTermination ( ) : void

Called when indicator terminates.

OpenConnection ( ) : void

Open a connection to Encog. Also send the HELLO packet.

ParseCSV ( string line ) : IList

Parse a line of CSV. Lines can have quote escaped text. A quote inside a string should be HTML escaped (i.e. ") Only " is supported, and it must be lower case. Ideally, I would like to use HttpUtility, however, in .Net 3.5, used by NT, this requires an additonal reference, which is an extra step in the setup process.

PerformError ( string whatError ) : void

Handle an error. Display the error to the user, log it, and set the state to error. No further processing on this indicator will occur.

PerformGoodBye ( ) : void

Tell the remote that we are about to disconnect.

Send ( String str ) : void

Send data to the remote socket, if we are connected. If we are not connected, ignore. Data is sent in ASCII.

Private Methods

Method Description
ParseArraySize ( string str, int &index, string &name ) : void

Parse an array size, for example "avg[5]". Return both the number, and the name before the brakets.

Method Details

DrawError() public method

public DrawError ( ) : void
return void

Eval() protected method

Evaluate a custom indicator. These indicators must be in the form: INDICATOR.VALUE[BARS_NEEDED] For example, MACD(12,26,9).Avg[1] This would request the current BAR of the Avg value of the MACD indicator. If the indicator has only one value, then the following format is used. EMA(14)[1] This would request the current bar of EMA, with a period of 14.
protected Eval ( string str ) : IDataSeries
str string The indicator string.
return IDataSeries

FillParams() protected method

Fill the parameters of a 3rd party indicator.
protected FillParams ( MethodInfo targetMethod, IList paramList ) : object[]
targetMethod System.Reflection.MethodInfo The name of the indicator( i.e. "MACD(12,26,9)")
paramList IList The parameter list.
return object[]

GotPacket() protected method

Process a packet.
protected GotPacket ( String line ) : void
line String The packet line.
return void

Initialize() protected method

This method is used to configure the indicator and is called once before any bar data is loaded.
protected Initialize ( ) : void
return void

OnBarUpdate() protected method

Called on each bar update event (incoming tick)
protected OnBarUpdate ( ) : void
return void

OnTermination() protected method

Called when indicator terminates.
protected OnTermination ( ) : void
return void

OpenConnection() protected method

Open a connection to Encog. Also send the HELLO packet.
protected OpenConnection ( ) : void
return void

ParseCSV() protected method

Parse a line of CSV. Lines can have quote escaped text. A quote inside a string should be HTML escaped (i.e. ") Only " is supported, and it must be lower case. Ideally, I would like to use HttpUtility, however, in .Net 3.5, used by NT, this requires an additonal reference, which is an extra step in the setup process.
protected ParseCSV ( string line ) : IList
line string The line to parse.
return IList

PerformError() protected method

Handle an error. Display the error to the user, log it, and set the state to error. No further processing on this indicator will occur.
protected PerformError ( string whatError ) : void
whatError string The error text.
return void

PerformGoodBye() protected method

Tell the remote that we are about to disconnect.
protected PerformGoodBye ( ) : void
return void

Send() protected method

Send data to the remote socket, if we are connected. If we are not connected, ignore. Data is sent in ASCII.
protected Send ( String str ) : void
str String The data to send to the remote.
return void

WaitForPacket() public method

Wait for a packet. Timeout if necessary.
public WaitForPacket ( ) : void
return void