Exemplo n.º 1
0
 public Benchmark(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
     bbLower = new BollingerBand(bars.close, parameter <int>("LengthDn"), -parameter <int>("NumDevsDn"));
     bbUpper = new BollingerBand(bars.close, parameter <int>("LengthUp"), parameter <int>("NumDevsUp"));
     addToPlot(bbLower, "bbLower", Color.Blue);
     addToPlot(bbUpper, "bbUpper", Color.Blue);
 }
Exemplo n.º 2
0
        public DTDRichCheapV2(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
        {
            requireOrdered("exitShortLevel", "triggerShort");
            requireOrdered("triggerLong", "exitLongLevel");
            requireOrdered("triggerLong", "exitShortLevel");
            requireOrdered("exitLongLevel", "triggerShort");
            if (!isActive())
            {
                return;
            }

            richCheap    = symbol.relatedSuffix("RICHCHEAP").doubles(bars);
            dtd          = symbol.relatedSuffix("DTD").doubles(bars);
            spread       = symbol.relatedSuffix("SPREAD").doubles(bars);
            lengthZScore = parameter <int>("lengthZScore");
            zScore       = new ZScoreSpud(richCheap, lengthZScore, true);
            dv01         = symbol.relatedSuffix("DV01").doubles(bars);

            triggerLong             = parameter <double>("triggerLong");
            triggerShort            = parameter <double>("triggerShort");
            exitShort               = parameter <double>("exitShortLevel");
            exitLong                = parameter <double>("exitLongLevel");
            stopLoss                = parameter <double>("lossStopLevel");
            timeStopBars            = parameter <double>("timeStopBars");
            trailingStopFlag        = parameter <double>("trailingStopFlag");
            maxSpread               = parameter <double>("maxSpread");
            profitObjectiveMultiple = parameter <double>("profitObjectiveMultiple");

            trailingStop = 0;
            deactivate(() => dtd.hasContent() && richCheap.count() >= lengthZScore);

            addToPlot(dtd, "DTD", Color.Red, "dtd");
            addToPlot(richCheap, "Rich / Cheap", Color.Blue, "richCheap");
        }
Exemplo n.º 3
0
        public SwingMA(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
        {
            entryATRMargin = parameter <double>("EntryATRMargin");
            exitATRMargin  = 2 * entryATRMargin;
            stopATRs       = parameter <int>("StopATRs");
            riskDollars    = parameter <double>("RiskDollars");

            atr    = new AverageTrueRangeEW(bars, parameter <int>("ATRLen"));
            maSlow = new Average(bars.close, parameter <int>("MASlow"));
            //Set up raw moving average
            switch (parameter <int>("MAType"))
            {
            case 1:
                maSlow = new Average(bars.close, parameter <int>("MASlow"));
                maFast = new Average(bars.close, parameter <int>("MAFast"));
                break;

            case 2:
                maSlow = new KAMA(bars.close, 2, 30, parameter <int>("MASlow"));
                maFast = new KAMA(bars.close, 2, 30, parameter <int>("MAFast"));
                break;

            default:
                Bomb.toss("Not valid MAType");
                break;
            }

            addToPlot(maSlow, "maSlow", Color.Blue);
            addToPlot(maFast, "maFast", Color.Red);
            addToPlot(atr, "ATR", Color.Blue, "ATRPane");
        }
Exemplo n.º 4
0
        public NBarFade(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
        {
            atrLen         = parameter <int>("ATRLen");
            nDays          = parameter <int>("nDays");
            nATREntry      = parameter <double>("nATRentry");
            stopAfStep     = parameter <double>("stopAfStep");
            stopAfMax      = parameter <double>("stopAfMax");
            entryBarWindow = parameter <double>("entryBarWindow");
            closeBetter    = parameter <bool>("closeBetter");
            riskDollars    = parameter <double>("riskDollars");

            atr           = new AverageTrueRangeEW(bars, atrLen); // this should be a daily spud
            nATRStopStart = nATREntry * parameter <double>("exitATRmultiple");

            entryHighestHigh = bars.high.highest(nDays);
            entryLowestLow   = bars.low.lowest(nDays);
            var halfNDays = (int)Math.Round(nDays * 0.5, 0);

            exitHighestHigh = bars.high.highest(halfNDays);
            exitLowestLow   = bars.low.lowest(halfNDays);

            inConfirm = false;

            //Plot methods
            parabolicStop = null;
            stopIndicator = new RootSpud <double>(bars.manager);
            addToPlot(stopIndicator, "ParabolicStop", Color.Red);
            addToPlot(entryHighestHigh, "entryHighestHigh", Color.LightBlue);
            addToPlot(entryLowestLow, "entryLowestLow", Color.Blue);
            addToPlot(exitHighestHigh, "exitHighestHigh", Color.Pink);
            addToPlot(exitLowestLow, "exitLowestLow", Color.Salmon);
            addToPlot(bars.close, "price", Color.Purple);
            addToPlot(atr, "ATR", Color.Blue, "ATRPane");
        }
Exemplo n.º 5
0
        public ReverseDTD(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
        {
            requireOrdered("exitShortLevel", "triggerShort");
            requireOrdered("triggerLong", "exitLongLevel");
            requireOrdered("triggerLong", "exitShortLevel");
            requireOrdered("exitLongLevel", "triggerShort");
            if (!isActive())
            {
                return;
            }

            richCheap    = symbol.relatedSuffixFromFirstDot(".DTD.EQUITY.RICHCHEAP").doubles(bars);
            dtd          = symbol.relatedSuffixFromFirstDot(".DTD.EQUITY").doubles(bars);
            stockPrice   = symbol.relatedSuffixFromFirstDot(".UNADJSTOCKPRICE").doubles(bars);
            lengthZScore = parameter <int>("lengthZScore");
            zScore       = new ZScoreSpud(richCheap, lengthZScore, true);

            triggerLong      = parameter <double>("triggerLong");
            triggerShort     = parameter <double>("triggerShort");
            exitShort        = parameter <double>("exitShortLevel");
            exitLong         = parameter <double>("exitLongLevel");
            stopLoss         = parameter <double>("stopLoss");
            timeStopBars     = parameter <double>("timeStopBars");
            trailingStopFlag = parameter <double>("trailingStopFlag");
            minPrice         = parameter <double>("minPrice");
            tradeSize        = parameter <double>("tradeSize");
            atr = new AverageTrueRangeEW(bars, parameter <int>("ATRLen"));

            trailingStop = 0;
            deactivate(() => dtd.hasContent() && richCheap.count() >= lengthZScore);

            addToPlot(dtd, "DTD", Color.Red, "dtd");
            addToPlot(richCheap, "Rich / Cheap", Color.Blue, "richCheap");
        }
Exemplo n.º 6
0
        public DTDRichCheap(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
        {
            requireOrdered("exitShortLevel", "triggerShort");
            requireOrdered("triggerLong", "exitLongLevel");
            requireOrdered("triggerLong", "exitShortLevel");
            requireOrdered("exitLongLevel", "triggerShort");
            if (!isActive())
            {
                return;
            }

            richCheap    = symbol.relatedSuffix("RICHCHEAP").doubles(bars);
            dtd          = symbol.relatedSuffix("DTD").doubles(bars);
            lengthZScore = parameter <int>("lengthZScore");
            zScore       = new ZScoreSpud(richCheap, lengthZScore, true);

            triggerLong  = parameter <double>("triggerLong");
            triggerShort = parameter <double>("triggerShort");
            exitShort    = parameter <double>("exitShortLevel");
            exitLong     = parameter <double>("exitLongLevel");
            stopLoss     = parameter <double>("lossStopLevel");
            deactivate(() => dtd.hasContent() && richCheap.count() >= lengthZScore);

            addToPlot(dtd, "DTD", Color.Red, "dtd");
            addToPlot(richCheap, "Rich / Cheap", Color.Blue, "richCheap");
        }
Exemplo n.º 7
0
 public NBarBreakMA(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol, bars => bars.high, bars => bars.low)
 {
     maSlow = new EWMA(bars.close, parameter <double>("MASlow"));
     maFast = new EWMA(bars.close, parameter <double>("MAFast"));
     addToPlot(maSlow, "maSlow", Color.BlueViolet);
     addToPlot(maFast, "maFast", Color.DeepPink);
 }
Exemplo n.º 8
0
 public CommodityCarry(QREBridgeBase bridge, Pair pair) : base(bridge, pair)
 {
     leftPrior   = prior(pair.left).bars(bars[pair.left]);
     rightPrior  = prior(pair.right).bars(bars[pair.right]);
     spread      = new Minus(bars[pair.left].close, bars[pair.right].close);
     vol         = new StdDeviationOfSample(spread, parameter <int>("volWindow"));
     cutoff      = parameter <double>("payoutRatioCutoff");
     payoutRatio = new RootSpud <double>(bridge.manager);
 }
Exemplo n.º 9
0
 public BuySellAndHold(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
     buyOrSell = parameter <int>("buyOrSell");
     tradeSize = parameter <int>("TradeSize");
     if (!inputsValid())
     {
         deactivate();
     }
 }
Exemplo n.º 10
0
 public Simulator(SystemArguments args, BarLoader data, string topicPrefix)
 {
     newBarListeners     = new LazyDictionary <Symbol, Action <Bar> >(symbol => doNothing);
     this.data           = data;
     symbols             = args.symbols;
     bridge              = args.bridgeBase(topicPrefix);
     dateIndex           = 0;
     processBarComplete += doNothing;
     interval            = args.interval();
 }
Exemplo n.º 11
0
 public RSITargets(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
     atr           = new AverageTrueRangeEW(bars, parameter <int>("ATRLen"));
     rsiSpud       = new RSI(bars.close, parameter <int>("HalfLife"));
     entryLevel    = parameter <double>("EntryLevel");
     exitLevel     = parameter <double>("ExitLevel");
     stoppedFlag   = false;
     lastDirection = 0;
     lastStop      = 0;
 }
Exemplo n.º 12
0
 public FXCommodityClose(QREBridgeBase bridge, Symbol symbol)
     : base(bridge, symbol, bars => commoditySignal(bridge.arguments().parameters.get <int>("signal"), bars))
 {
     maFX             = new Average(bars.close, maDays);
     currencyReversed = symbol.name.StartsWith("USD");
     maxBarsHeld      = parameter <int>("MaxBarsHeld");
     addToPlot(upperBand, "UpperBand", Color.Blue, "Commodity");
     addToPlot(lowerBand, "LowerBand", Color.Blue, "Commodity");
     addToPlot(ma, "commodMovingAverage", Color.Red, "Commodity");
 }
Exemplo n.º 13
0
 public FadeWeekEndPush(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
     atr              = new AverageTrueRangeEW(bars, parameter <int>("ATRLen"));
     nDays            = parameter <int>("NDays");
     multiple         = parameter <double>("Multiple");
     risk             = parameter <double>("Risk");
     initialEquity    = parameter <double>("InitEquity");
     fixEquity        = parameter <bool>("FixEquity");
     exitDay          = parameter <int>("ExitDay");
     stopLossMultiple = parameter <double>("StopLossMultiple");
     bars.close.prepare();
 }
Exemplo n.º 14
0
 public TDSequential(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
     setupLength     = parameter <int>("SetupLength");
     version         = parameter <int>("Version");
     waitForFlip     = parameter <int>("WaitForFlipOnEntry");
     countdownLength = parameter <int>("CountdownLength");
     setupCount      = new TDSetup(bars);
     setupInPlace    = 0;
     stopLevel       = 0;
     tdCountdown     = 0;
     bars.close.prepare();
 }
Exemplo n.º 15
0
 public SectorRotationShort(QREBridgeBase bridge, IEnumerable <Symbol> symbols) : base(bridge)
 {
     risk                    = parameter <int>("Risk");
     nBest                   = parameter <int>("NBest");
     daysBuffer              = parameter <int>("DaysBuffer");
     minBasketSize           = parameter <int>("MinBasketSize");
     maxNBestBasketSizeRatio = parameter <double>("MaxNBestBasketSizeRatio");
     cumulative              = parameter <int>("Cumulative");
     leadBars                = parameter <int>("LeadBars");
     daysInTrade             = parameter <int>("DaysInTrade");
     financialCenter         = FinancialCenterTable.CENTER.name(39);
     eachValue(bars, barSpud => barSpud.times.prepare());
 }
Exemplo n.º 16
0
 public FXCarry(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
     payoutRatio        = payoutRatioSymbol(symbol).doubles(bars);
     atr                = new AverageTrueRange(bars, 100);
     tradeSizeParameter = parameter <double>("TradeSize");
     recoveryAmount     = parameter <double>("RecoveryAmount") * tradeSizeParameter;
     recoveryPeriod     = parameter <int>("RecoveryPeriod");
     trigger            = parameter <double>("Trigger");
     maxTrigger         = parameter <double>("MaxTrigger");
     triggerCushion     = parameter <double>("TriggerCushion");
     addToPlot(payoutRatio, "payoutRatio", Color.Red, "payoutRatio");
     bars.close.prepare();
     stoppedOut();
 }
Exemplo n.º 17
0
        protected TrendingMABase(QREBridgeBase bridge, Symbol symbol, Converter <BarSpud, Spud <double> > signalSeries) : base(bridge, symbol)
        {
            maDays      = parameter <int>("MADays");
            riskDollars = parameter <double>("RiskDollars");
            atr         = new AverageTrueRange(bars, parameter <int>("ATRLen"));
            signal      = signalSeries(bars);
            ma          = new Average(signal, maDays);
            shortSum    = new Sum(signal, maDays - 1);
            var numDeviations = parameter <double>("BollingerBandDeviations");
            var barsBack      = parameter <int>("BollingerBandBarsBack");

            upperBand = new BollingerBand(ma, barsBack, numDeviations);
            lowerBand = new BollingerBand(ma, barsBack, -numDeviations);
        }
Exemplo n.º 18
0
        public CouponSwap(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
        {
            //Set up signal data
            string tickerHeader;

            if (symbol.name.Substring(symbol.name.Length - 3, 3) == "TRS")
            {
                tickerHeader = symbol.name.Substring(0, 5);
            }
            else if (Regex.IsMatch(symbol.name, @"....\.\d"))
            {
                var tickerParts = symbol.name.Split(Convert.ToChar("."));
                tickerHeader = (tickerParts[0] == "FNCL" ? "F" : "D");
                tickerHeader = tickerHeader + tickerParts[1] + tickerParts[2];
                tickerHeader = tickerHeader + tickerParts[3] + tickerParts[4];
            }
            else
            {
                throw Bomb.toss("Bad symbol name, not able to figure out the signal data.");
            }

            modelPrice  = new Symbol(tickerHeader + "MDL").doubles(bars);
            actualPrice = new Symbol(tickerHeader + "ACT").doubles(bars);
            rollDecimal = new Symbol(tickerHeader + "WRL").doubles(bars);
            rollTicks   = new Times(rollDecimal, rollDecimal.manager.constant(32.0));

            tradeSize  = parameter <long>("TradeSize");
            maxSize    = parameter <long>("MaxPyramid") * tradeSize;
            entryTicks = parameter <double>("EntryTicks");
            stopTicks  = parameter <double>("StopTicks");

            richCheap       = new RichCheapSpud(modelPrice, actualPrice);
            longEntryCross  = new CrossOverSpud <double>(richCheap, entryTicks);
            shortEntryCross = new CrossOverSpud <double>(richCheap, -entryTicks);
            longExitCross   = new CrossOverSpud <double>(richCheap, parameter <double>("ExitTicks"));
            shortExitCross  = new CrossOverSpud <double>(richCheap, -parameter <double>("ExitTicks"));

            longMA           = new EWMA(richCheap, parameter <double>("HalfLife"));
            rollCutOff       = parameter <double>("RollCutOff");
            rollCutOffMargin = parameter <double>("RollCutOff.Margin");

            longRollCross  = new CrossOverSpud <double>(rollDecimal, -(rollCutOff - rollCutOffMargin) / 32);
            shortRollCross = new CrossOverSpud <double>(rollDecimal, (rollCutOff - rollCutOffMargin) / 32);

            //Add Plots
            addToPlot(modelPrice, "Model Price", Color.Red, "Coupon Swap");
            addToPlot(actualPrice, "Actual Price", Color.Blue, "Coupon Swap");
            addToPlot(rollTicks, "Weighted Roll", Color.Green, "Roll");
        }
Exemplo n.º 19
0
        public FaderClose(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
        {
            //Set up raw moving average
            var maLength = parameter <int>("maLength");

            switch (parameter <int>("maType"))
            {
            case 1:
                maRaw = new Average(bars.close, maLength);
                break;

            case 2:
                maRaw = new KAMA(bars.close, 2, 30, maLength);
                break;

            default:
                Bomb.toss("Not valid maType");
                break;
            }

            //Set up stdDev
            priceStDev = new StdDeviationOfSample(bars.close, parameter <int>("stDevLength"));

            //Set up regression
            regressionBars = parameter <int>("regressionBars");
            Bomb.when((parameter <int>("LeadBars") < regressionBars), () => "LeadBars cannot be less than regressionBars." + arguments());
            var count = new BarCounter(bars).transform(i => (double)i);

            projectionSpud     = new QRegression(maRaw, count, regressionBars, false);
            regressionProjBars = parameter <int>("regressionProjectionBars");
            levelProjection    = projectionSpud.transform(barsRegression => barsRegression.predict(count + regressionProjBars));

            //Set up other parameters
            zEntry       = parameter <double>("ZEntry");
            zExit        = parameter <double>("ZExit");
            minPnLMultTC = parameter <double>("minPnLMultTC");
            stopMultiple = parameter <double>("stopMultiple");
            riskDollars  = parameter <double>("RiskDollars");
            rSqrScale    = parameter <double>("rSqrScale");
            Bomb.when((rSqrScale != 0), () => "rSquare parameter not implemented yet.");

            addToPlot(maRaw, "maRaw", Color.Blue);
            addToPlot(levelProjection, "Projection", Color.Red);
            addToPlot(priceStDev, "StDev", Color.Green, "Support");
        }
Exemplo n.º 20
0
        public LiqInjT(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
        {
            beta      = symbol.relatedPrefix("LIB" + "10").doubles(bars);
            betaShort = symbol.relatedPrefix("LIO" + "10").doubles(bars);
            residual  = symbol.relatedPrefix("LIV" + "10").doubles(bars);
            zScore    = symbol.relatedPrefix("LIZ" + "10").doubles(bars, 0);
            tc        = symbol.relatedPrefix("LIC" + "10").doublesNoLive(bars);
            acf       = new EWAcf(zScore, parameter <double>("acfHalfLife"), parameter <int>("acfLag"));

            zScoreMin       = parameter <double>("zScoreMin");
            pScoreMin       = parameter <double>("pScoreMin");
            betaMin         = parameter <double>("betaMin");
            betaMax         = parameter <double>("betaMax");
            acfTrigger      = parameter <double>("acfTrigger");
            risk            = parameter <long>("risk");
            stopMultiple    = parameter <double>("stopMultiple");
            targetNetProfit = stopMultiple * risk;
        }
Exemplo n.º 21
0
        protected NDayBreakBase(QREBridgeBase bridge, Symbol symbol,
                                Converter <BarSpud, ComparableSpud <double> > high,
                                Converter <BarSpud, ComparableSpud <double> > low
                                ) : base(bridge, symbol)
        {
            atr = new AverageTrueRangeEW(bars, parameter <int>("ATRLen"));

            breakDays     = parameter <int>("BreakDays") - 1;
            breakOutHigh  = high(bars).highest(breakDays);
            breakOutLow   = low(bars).lowest(breakDays);
            breakDownHigh = high(bars).highest(breakDays / 2);
            breakDownLow  = low(bars).lowest(breakDays / 2);

            risk = parameter <double>("Risk");

            addToPlot(breakOutHigh, "breakout high", Color.Red);
            addToPlot(breakOutLow, "breakout low", Color.Blue);
            addToPlot(breakDownHigh, "breakdown high", Color.DeepPink);
            addToPlot(breakDownLow, "breakdown low", Color.DeepSkyBlue);
        }
Exemplo n.º 22
0
        public ITrend(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
        {
            atrLength       = parameter <int>("atrLength");
            sizeScaleSwitch = parameter <int>("sizeScaleSwitch");
            nATRStop        = parameter <double>("nATRStop");
            nATRTrigger     = parameter <double>("nATRTrigger");
            dailyATRSwitch  = parameter <int>("useDailyATR");
            risk            = parameter <int>("risk");
            timeStampClose  = parameter <double>("timeStampClose");
            timeStampMark   = parameter <double>("timeStampMark");

            atr = new AverageTrueRangeEW(
                dailyATRSwitch == 1 ? (Spud <Bar>) new IntervalSpud(bars, Interval.DAILY) : bars,
                atrLength);

            scaleWeights = new double[10];
            zeroTo(scaleWeights.Length, i => scaleWeights[i] = 1.5 - (double)i / 9);
            scaleWins = new double[10];
            initializeWinScale();
            financialCenter = FinancialCenterTable.CENTER.name(39);
        }
Exemplo n.º 23
0
        public LiqInj(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
        {
            version  = symbol.name.Substring(3, 2);
            residual = symbol.relatedPrefix("PTV" + version).doubles(bars);
            tc       = symbol.relatedPrefix("PTC" + version).doublesNoLive(bars);
            rSquare  = symbol.relatedPrefix("PTR" + version).doubles(bars);
            hedge    = symbol.relatedPrefix("PTH" + version).doubles(bars);
            scale    = symbol.relatedPrefix("PTS" + version).doublesNoLive(bars, 0);
            var atrLength = parameter <int>("ATRLength");

            nATR = parameter <double>("nATR");
            if (nATR != 0 && atrLength != 0)
            {
                atr = new AverageTrueRange(bars, atrLength);
            }
            zScore = symbol.relatedPrefix("PTZ" + version).doubles(bars, 0);
            acf    = new EWAcf(zScore, parameter <double>("acfHalfLife"), parameter <int>("acfLag"));

            zScoreMin              = parameter <double>("zScoreMin");
            pScoreMin              = parameter <double>("pScoreMin");
            rSquareMin             = parameter <double>("rSquareMin");
            hedgeSwitch            = parameter <int>("hedgeSwitch");
            hedgeMin               = parameter <double>("hedgeMin");
            hedgeMax               = parameter <double>("hedgeMax");
            acfTrigger             = parameter <double>("acfTrigger");
            scaleMin               = parameter <double>("scaleMin");
            startSize              = parameter <long>("startSize");
            stopMultiple           = parameter <double>("stopMultiple");
            bridge.manager.onLive += () => {
                if (startOfDayPosition != null)
                {
                    livePosition = startOfDayPosition;
                }
                if (startOfDayTargetNetProfit.HasValue)
                {
                    liveTargetNetProfit = startOfDayTargetNetProfit;
                }
            };
            addToPlot(zScore, "zScore", Color.Red, "zScore");
        }
Exemplo n.º 24
0
 public FXCarryV2(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
     payoutRatioLong  = payoutRatioSymbol(symbol, "Long").doubles(bars).allowStaleTicks();
     payoutRatioShort = payoutRatioSymbol(symbol, "Short").doubles(bars).allowStaleTicks();
     nATR             = parameter <int>("nATR");
     atrLen           = parameter <int>("ATRLen");
     atr                   = new AverageTrueRange(bars, atrLen);
     riskDollars           = parameter <double>("RiskDollars");
     bollingerBandBarsBack = parameter <int>("BollingerBandBarsBack");
     ma = new Average(bars.close, bollingerBandBarsBack);
     bollingerBandDeviations = parameter <double>("BollingerBandDeviations");
     trigger        = parameter <double>("Trigger");
     maxTrigger     = parameter <double>("MaxTrigger");
     triggerCushion = parameter <double>("TriggerCushion");
     addToPlot(payoutRatioLong, "payoutRatioLong", Color.Red, "payoutRatioLong");
     addToPlot(payoutRatioShort, "payoutRatioShort", Color.Red, "payoutRatioShort");
     upperBand = new BollingerBand(bars.close, bollingerBandBarsBack, bollingerBandDeviations);
     lowerBand = new BollingerBand(bars.close, bollingerBandBarsBack, -bollingerBandDeviations);
     addToPlot(upperBand, "upperBand", Color.Blue);
     addToPlot(lowerBand, "lowerBand", Color.Blue);
     bars.close.prepare();
     stoppedOut = true;
 }
Exemplo n.º 25
0
 public StopSystem(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
     bars.close.prepare();
 }
Exemplo n.º 26
0
 public TrendingMAClose(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol, bars => bars.close)
 {
 }
Exemplo n.º 27
0
 protected DTDPortfolioMultiSymbolBase(QREBridgeBase bridge) : base(bridge)
 {
 }
Exemplo n.º 28
0
 public MaxBarsSystem(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
 }
Exemplo n.º 29
0
 public TestSystem(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
 }
Exemplo n.º 30
0
 public DTDPortfolioPositionLimits(QREBridgeBase bridge) : base(bridge)
 {
     manager            = new MaxTradesManager <DTDRichCheapV2, Symbol>(systems_.Values, parameter <int>("maxPositions"), compareSystems, placeExits);
     slippageMultiplier = parameter <double>("requiredSlippageMultiplier");
 }