C# Class Forex_Strategy_Builder.Indicator

Class Indicator.
Mostrar archivo Open project: nuggett11/Forex-Strategy-Builder Class Usage Examples

Public Methods

Method Description
Calculate ( SlotTypes slotType ) : void

Calculates the components

Indicator ( ) : System

The default constructor

SetDescription ( SlotTypes slotType ) : void

Sets the indicator logic description

TestPossibleSlot ( SlotTypes slotType ) : bool

Tests if this is one of the possible slots.

Protected Methods

Method Description
BandIndicatorLogic ( int firstBar, int prvs, double adUpperBand, double adLowerBand, IndicatorComp &indCompLong, IndicatorComp &indCompShort, BandIndLogic indLogic ) : bool

Calculates the logic of a band indicator.

BarClosesAboveIndicatorLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "The bar closes above the Indicator"

BarClosesBelowIndicatorLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "The bar closes below the Indicator"

BarOpensAboveIndicatorAfterOpeningBelowLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "The bar opens above the Indicator after opening below it"

BarOpensAboveIndicatorLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "The bar opens above the Indicator"

BarOpensBelowIndicatorAfterOpeningAboveLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "The bar opens below the Indicator after opening above it"

BarOpensBelowIndicatorLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "The bar opens below the Indicator"

IndicatorCrossesAnotherIndicatorDownwardLogic ( int firstBar, int prvs, double adIndValue, double adAnotherIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "The Indicator crosses AnotherIndicator downward"

IndicatorCrossesAnotherIndicatorUpwardLogic ( int firstBar, int prvs, double adIndValue, double adAnotherIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "The Indicator crosses AnotherIndicator upward"

IndicatorFallsLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "Indicator falls"

IndicatorIsHigherThanAnotherIndicatorLogic ( int firstBar, int prvs, double adIndValue, double adAnotherIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "The Indicator is higher than the AnotherIndicator"

IndicatorIsLowerThanAnotherIndicatorLogic ( int firstBar, int prvs, double adIndValue, double adAnotherIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "The Indicator is lower than the AnotherIndicator"

IndicatorRisesLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void

Returns signals for the logic rule "Indicator rises".

MovingAverage ( int period, int shift, MAMethod maMethod, double adSource ) : double[]

Calculates a Moving Average

NoDirectionOscillatorLogic ( int firstBar, int prvs, double adIndValue, double dLevel, IndicatorComp &indComp, IndicatorLogic indLogic ) : bool

Calculates the logic of a No Direction Oscillator.

OscillatorLogic ( int firstBar, int prvs, double adIndValue, double levelLong, double levelShort, IndicatorComp &indCompLong, IndicatorComp &indCompShort, IndicatorLogic indLogic ) : bool

Calculates the logic of an Oscillator.

PrepareUsePrevBarValueCheckBox ( SlotTypes slotType ) : bool

Sets the check box "Use previous bar value"

Price ( BasePrice price ) : double[]

Calculates the base price.

Sigma ( ) : double

Maximum error for comparing indicator values

Method Details

BandIndicatorLogic() protected method

Calculates the logic of a band indicator.
protected BandIndicatorLogic ( int firstBar, int prvs, double adUpperBand, double adLowerBand, IndicatorComp &indCompLong, IndicatorComp &indCompShort, BandIndLogic indLogic ) : bool
firstBar int The first bar number.
prvs int To use the previous bar or not.
adUpperBand double The Upper band values.
adLowerBand double The Lower band values.
indCompLong IndicatorComp Indicator component for Long position.
indCompShort IndicatorComp Indicator component for Short position.
indLogic BandIndLogic The chosen logic.
return bool

BarClosesAboveIndicatorLogic() protected method

Returns signals for the logic rule "The bar closes above the Indicator"
protected BarClosesAboveIndicatorLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

BarClosesBelowIndicatorLogic() protected method

Returns signals for the logic rule "The bar closes below the Indicator"
protected BarClosesBelowIndicatorLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

BarOpensAboveIndicatorAfterOpeningBelowLogic() protected method

Returns signals for the logic rule "The bar opens above the Indicator after opening below it"
protected BarOpensAboveIndicatorAfterOpeningBelowLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

BarOpensAboveIndicatorLogic() protected method

Returns signals for the logic rule "The bar opens above the Indicator"
protected BarOpensAboveIndicatorLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

BarOpensBelowIndicatorAfterOpeningAboveLogic() protected method

Returns signals for the logic rule "The bar opens below the Indicator after opening above it"
protected BarOpensBelowIndicatorAfterOpeningAboveLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

BarOpensBelowIndicatorLogic() protected method

Returns signals for the logic rule "The bar opens below the Indicator"
protected BarOpensBelowIndicatorLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

Calculate() public method

Calculates the components
public Calculate ( SlotTypes slotType ) : void
slotType SlotTypes
return void

Indicator() public method

The default constructor
public Indicator ( ) : System
return System

IndicatorCrossesAnotherIndicatorDownwardLogic() protected method

Returns signals for the logic rule "The Indicator crosses AnotherIndicator downward"
protected IndicatorCrossesAnotherIndicatorDownwardLogic ( int firstBar, int prvs, double adIndValue, double adAnotherIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
adAnotherIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

IndicatorCrossesAnotherIndicatorUpwardLogic() protected method

Returns signals for the logic rule "The Indicator crosses AnotherIndicator upward"
protected IndicatorCrossesAnotherIndicatorUpwardLogic ( int firstBar, int prvs, double adIndValue, double adAnotherIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
adAnotherIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

IndicatorFallsLogic() protected method

Returns signals for the logic rule "Indicator falls"
protected IndicatorFallsLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

IndicatorIsHigherThanAnotherIndicatorLogic() protected method

Returns signals for the logic rule "The Indicator is higher than the AnotherIndicator"
protected IndicatorIsHigherThanAnotherIndicatorLogic ( int firstBar, int prvs, double adIndValue, double adAnotherIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
adAnotherIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

IndicatorIsLowerThanAnotherIndicatorLogic() protected method

Returns signals for the logic rule "The Indicator is lower than the AnotherIndicator"
protected IndicatorIsLowerThanAnotherIndicatorLogic ( int firstBar, int prvs, double adIndValue, double adAnotherIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
adAnotherIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

IndicatorRisesLogic() protected method

Returns signals for the logic rule "Indicator rises".
protected IndicatorRisesLogic ( int firstBar, int prvs, double adIndValue, IndicatorComp &indCompLong, IndicatorComp &indCompShort ) : void
firstBar int
prvs int
adIndValue double
indCompLong IndicatorComp
indCompShort IndicatorComp
return void

MovingAverage() protected static method

Calculates a Moving Average
protected static MovingAverage ( int period, int shift, MAMethod maMethod, double adSource ) : double[]
period int Period
shift int Shift
maMethod MAMethod Method of calculation
adSource double
return double[]

NoDirectionOscillatorLogic() protected method

Calculates the logic of a No Direction Oscillator.
protected NoDirectionOscillatorLogic ( int firstBar, int prvs, double adIndValue, double dLevel, IndicatorComp &indComp, IndicatorLogic indLogic ) : bool
firstBar int The first bar number.
prvs int To use the previous bar or not.
adIndValue double The indicator values.
dLevel double The Level value.
indComp IndicatorComp Indicator component where to save the results.
indLogic IndicatorLogic The chosen logic.
return bool

OscillatorLogic() protected method

Calculates the logic of an Oscillator.
protected OscillatorLogic ( int firstBar, int prvs, double adIndValue, double levelLong, double levelShort, IndicatorComp &indCompLong, IndicatorComp &indCompShort, IndicatorLogic indLogic ) : bool
firstBar int The first bar number.
prvs int To use the previous bar or not.
adIndValue double The indicator values.
levelLong double The Level value for a Long position.
levelShort double The Level value for a Short position.
indCompLong IndicatorComp Indicator component for Long position.
indCompShort IndicatorComp Indicator component for Short position.
indLogic IndicatorLogic The chosen logic.
return bool

PrepareUsePrevBarValueCheckBox() protected method

Sets the check box "Use previous bar value"
protected PrepareUsePrevBarValueCheckBox ( SlotTypes slotType ) : bool
slotType SlotTypes
return bool

Price() protected static method

Calculates the base price.
protected static Price ( BasePrice price ) : double[]
price BasePrice The base price type.
return double[]

SetDescription() public method

Sets the indicator logic description
public SetDescription ( SlotTypes slotType ) : void
slotType SlotTypes
return void

Sigma() protected method

Maximum error for comparing indicator values
protected Sigma ( ) : double
return double

TestPossibleSlot() public method

Tests if this is one of the possible slots.
public TestPossibleSlot ( SlotTypes slotType ) : bool
slotType SlotTypes The slot we test.
return bool