public override void Init(string pParameters) { this.InitializeParameters(pParameters, "CCI:14;TCCI:6;MINUTES:5;"); CCIPeriods = (int)PParser.GetDouble("CCI", 0); TCCIPeriods = (int)PParser.GetDouble("TCCI", 0); Minutes = (int)PParser.GetDouble("MINUTES", 0); CCI = new iCCI(CCIPeriods); TCCI = new iCCI(TCCIPeriods); CCISlope = new iDerivatives(); CCIH = new CQueue(CCIPeriods * 3); TCCIH = new CQueue(CCIPeriods * 3); // OPTIMIZATION PARAMETER CHECK // if parameters are erroneous (TurboCCI length > CCI) // do not register candle listeners // SystemTester will then not send us any ticks // and go to the next iteration // need 6 cci bars to determine trend if ((TCCIPeriods < CCIPeriods) || (CCIPeriods < 6)) { cbx = new cCandleBuilder(Minutes, 10); Framework.TickServer.RegisterTickListener("cbx", "*", cbx); cbx.RegisterCandleListener("cbx", this); Framework.TickServer.RegisterTickListener("System", "*", this); Framework.WriteGraphLine("InTrade,Margin,C,CCI,CCIDelta,CCISpeed,TCCI,TypeOfTrade,Direction,BelowFifty,ZLR"); } }
public override void Init(string pParameters) { InitializeParameters(pParameters, "SRSI:14;MINUTES:5;"); RSIPeriods = (int)PParser.GetDouble("SRSI", 0); StochRSI = new iStochRSI(RSIPeriods); RSISlope = new iSlope(); Minutes = (int)PParser.GetDouble("MINUTES", 0); cbx = new cCandleBuilder(Minutes, 10); cbx.RegisterCandleListener("cbx", this); Framework.TickServer.RegisterTickListener("cbx", "*", cbx); Framework.TickServer.RegisterTickListener("System", "*", this); Framework.WriteGraphLine("StochRSI,RSISlope,InTrade,Margin"); // this is optional // demonstrates we have complete control over ticks served LoadTicks(); // only if specified by parameters FILE1 and FILE2 SelectTicks(); // this is optional // demonstrates registration of multiple period candles cb10 = new cCandleBuilder(10, 4); cb10.RegisterCandleListener("cb10", this); Framework.TickServer.RegisterTickListener("cb10", "*", cb10); }
public override void Init(string pParameters) { this.InitializeParameters(pParameters, "BB:20;WIDTH:-1;HMA:10;BWT:0.0008;BWRT:0.0002;TS:0.0003;MINUTES:5;"); State = 0; iPeriods = (int)PParser.GetDouble("BB", 0); iWidth = (int)PParser.GetDouble("WIDTH", 0); iHMALen = (int)PParser.GetDouble("HMA", 0); Minutes = (int)PParser.GetDouble("MINUTES", 0); BWThreshold = PParser.GetDouble("BWT", 0); BWReversalThreshold = PParser.GetDouble("BWRT", 0); TrailingStop = PParser.GetDouble("TS", 0); BBands = new iBollingerBands(iPeriods, iWidth); HMA = new iHMA(iHMALen); SMASlope = new iSlope(); cbx = new cCandleBuilder(Minutes, 10); Framework.TickServer.RegisterTickListener("cbx", "*", cbx); cbx.RegisterCandleListener("cbx", this); Framework.TickServer.RegisterTickListener("System", "*", this); Framework.WriteGraphLine("InTrade,Margin,B+,C,HMA,SMA,B-,State,BWidth,MinBWidth,EntryRecommend"); }
// initialization routine, called once before ticks are sent // if multiple tick sources are used, will get called several times // during the lifetime of the object, once per tick source change public override void Init(string pParameters) { // save parameters sent in case they contain optional parameters RealParameters = pParameters; // a Parameter Parser can be instantiated to check optional parameters RParser = new ParameterParser(pParameters); // this is a mandatory list of parameters. // Optional parameters are not specified here // they need to be checked before DParser.Merge is called // or checked from the RealParameters variable DefaultParameters = "PERIODLONG:17;PERIODSHORT:2;MINUTES:10;DELTA1:0.0005;DELTA2:0.0016;"; // parameters as specified by the user PParser = new ParameterParser(pParameters); // mandatory parameter list and default values DParser = new ParameterParser(DefaultParameters); // make a list of parameters from mandatory list // merge user values if existing, otherwise use defaults Parameters = DParser.Merge(PParser); // build a new parameter parser with sanitized parameter and values // now user values have been merged with desired parameters // extraneous, or optional parameters eliminated. PParser = new ParameterParser(Parameters); // get periods to use for the indicator(s) PeriodsLong = (int)PParser.GetDouble("PERIODLONG", 0); PeriodsShort = (int)PParser.GetDouble("PERIODSHORT", 0);; Delta1 = PParser.GetDouble("DELTA1", 0); Delta2 = PParser.GetDouble("DELTA2", 0); // now indicators must be instantiated // your indicator instantiation goes here // end of indicator instantiation // instantiate candlebuilder with desired timeframe Minutes = (int)PParser.GetDouble("MINUTES", 0); // cbx = new cCandleBuilder(Minutes,PeriodsLong+PeriodsShort+1); cbx = new cCandleBuilder(Minutes, PeriodsLong + PeriodsShort + 20); // register candlebuilder as a tick listener, name unimportant Framework.TickServer.RegisterTickListener("cbx", "*", cbx); // register this object as a candle listener // the candle name is important since we might receive // several candles with same period. cbx.RegisterCandleListener("cbx", this); // multiple candlebuilders can be setup by using previous 4 lines. // register this object as a tick listener, name unimportant // this is an optional step to receive ticks in between candles Framework.TickServer.RegisterTickListener("System", "*", this); // start header line of numerical output file Framework.WriteGraphLine("InTrade,Margin,AvgMRLong,AvgMRShort,Der2,MaxAbsDer2"); }
public override void Init(string pParameters) { this.InitializeParameters(pParameters, "MINUTES:5;"); Minutes = (int)PParser.GetDouble("MINUTES", 0); RNG = new Random(); cbx = new cCandleBuilder(Minutes, 10); Framework.TickServer.RegisterTickListener("cbx", "*", cbx); cbx.RegisterCandleListener("cbx", this); Framework.TickServer.RegisterTickListener("System", "*", this); Framework.WriteGraphLine("InTrade,Margin,C"); }
public override void Init(string pParameters) { this.InitializeParameters(pParameters, "MINUTES:5;CHANNEL:25;TRAILSTOP:0.0010;"); Minutes = (int)PParser.GetDouble("MINUTES", 0); channel = (int)PParser.GetDouble("CHANNEL", 0); trailstop = PParser.GetDouble("TRAILSTOP", 0); minmax = new iMinMax(2 * channel); cbx = new cCandleBuilder(Minutes, 10); Framework.TickServer.RegisterTickListener("cbx", "*", cbx); cbx.RegisterCandleListener("cbx", this); Framework.TickServer.RegisterTickListener("System", "*", this); Framework.WriteGraphLine("InTrade,Margin,C"); }
// initialization routine, called once before ticks are sent // if multiple tick sources are used, will get called several times // during the lifetime of the object, once per tick source change public override void Init(string pParameters) { // initialize all ParameterParsers this.InitializeParameters(pParameters, "PERIODS:14;MINUTES:5;"); // get periods to use for the indicator(s) iPeriods = (int)PParser.GetDouble("PERIODS", 0); // now indicators must be instantiated // your indicator instantiation goes here // end of indicator instantiation // instantiate candlebuilder with desired timeframe Minutes = (int)PParser.GetDouble("MINUTES", 0); cbx = new cCandleBuilder(Minutes, 10); // register candlebuilder as a tick listener, name unimportant Framework.TickServer.RegisterTickListener("cbx", "*", cbx); // register this object as a candle listener // the candle name is important since we might receive // several candles with same period. cbx.RegisterCandleListener("cbx", this); // multiple candlebuilders can be setup by using previous 4 lines. // register this object as a tick listener, name unimportant // this is an optional step to receive ticks in between candles Framework.TickServer.RegisterTickListener("System", "*", this); // start header line of numerical output file Framework.WriteGraphLine("InTrade,Margin"); // this is optional // demonstrates we have complete control over ticks served // this function loads different tick sources // in order to execute the same algorithm with the same parameters // in several different tick sources and compare the results // LoadTick imports ticks from FILE1 and FILE2 if the parameters exist. LoadTicks(); // this function observes how many times the object has been executed // and selects the appropriate tick source for the run. SelectTicks(); }
// initialization routine, called once before ticks are sent // if multiple tick sources are used, will get called several times // during the lifetime of the object, once per tick source change public override void Init(string pParameters) { // initialize all ParameterParsers this.InitializeParameters(pParameters, "PERIODS:14;MINUTES:5;"); // get periods to use for the indicator(s) iPeriods = (int)PParser.GetDouble("PERIODS", 0); // now indicators must be instantiated // your indicator instantiation goes here IndicatorDump = new oIndicatorDump(iPeriods); // end of indicator instantiation // instantiate candlebuilder with desired timeframe Minutes = (int)PParser.GetDouble("MINUTES", 0); cbx = new cCandleBuilder(Minutes, 10); // register candlebuilder as a tick listener, name unimportant Framework.TickServer.RegisterTickListener("cbx", "*", cbx); // register this object as a candle listener // the candle name is important since we might receive // several candles with same period. cbx.RegisterCandleListener("cbx", this); // multiple candlebuilders can be setup by using previous 4 lines. // register this object as a tick listener, name unimportant // this is an optional step to receive ticks in between candles Framework.TickServer.RegisterTickListener("System", "*", this); // start header line of numerical output file string Header = IndicatorDump.GetHeader(); Header = "InTrade,Margin," + Header; Framework.WriteGraphLine(Header); }
// initialization routine, called once before ticks are sent // if multiple tick sources are used, will get called several times // during the lifetime of the object, once per tick source change public override void Init(string pParameters) { this.InitializeParameters(pParameters, "PERIODS:17;MINUTES:10;"); // get periods to use for the indicator(s) Periods = (int)PParser.GetDouble("PERIODS", 0); Derivatives = new iDerivatives(); HMA = new iHMA(Periods); HMAD1 = new CQueue(Periods); FMA = new iFMA(Periods); Deriv1 = new CQueue(Periods); Deriv2 = new CQueue(Periods); BBands = new iBollingerBands(Periods, -1); StochRSI = new iStochRSI(Periods); CCI = new iCCI(Periods); // instantiate candlebuilder with desired timeframe Minutes = (int)PParser.GetDouble("MINUTES", 0); // cbx = new cCandleBuilder(Minutes,PeriodsLong+PeriodsShort+1); cbx = new cCandleBuilder(Minutes, Periods); // register candlebuilder as a tick listener, name unimportant Framework.TickServer.RegisterTickListener("cbx", "*", cbx); // register this object as a candle listener // the candle name is important since we might receive // several candles with same period. cbx.RegisterCandleListener("cbx", this); // multiple candlebuilders can be setup by using previous 4 lines. // register this object as a tick listener, name unimportant // this is an optional step to receive ticks in between candles Framework.TickServer.RegisterTickListener("System", "*", this); // start header line of numerical output file Framework.WriteGraphLine("InTrade,Margin,C,TP,FMA,HMA,Deriv1,Deriv2,SMA,BBand1,BBand2,%b,Bandwidth,StochRSI,CCI"); }