Ein Trade erfordert, dass SuperTrend(3, 5) nach einem begrenzten Verlauf dreht, Parabolic SAR auf der richtigen Seite des Preises liegt und das MACD-Histogramm eine Bewegung über eine festgelegte Größe macht. Ein geglätteter Wert für Kauf- und Verkaufsdruck muss übereinstimmen. Diese Strategie wurde noch nicht per Backtest geprüft.
| positionSize Größe pro Punkt | 1 |
| stMultiplier SuperTrend ATR-Multiplikator | 3 |
| stPeriod SuperTrend ATR-Länge | 5 |
| sarStart Parabolic SAR Startfaktor | 0.02 |
| sarStep Parabolic SAR Schrittweite | 0.02 |
| sarMax Parabolic SAR Maximalfaktor | 0.03 |
| macdFast MACD schnelle Länge | 12 |
| macdSlow MACD langsame Länge | 26 |
| macdLineArg Drittes MACDline-Argument, wie veröffentlicht | 150 |
| macdSignalPeriod EMA der MACD-Linie, die als Signal dient | 9 |
| lookbackPeriod Fenster für die Druckberechnung | 100 |
| pressurePeriod EMA-Länge, die Kauf- und Verkaufsdruck glättet | 500 |
| minTrendBars SuperTrend muss seine Seite länger als diesen Wert gehalten haben | 15 |
| longMacdSlope Mindestanstieg des MACD-Histogramms für Longs (Punkte) | 0.045 |
| shortMacdSlope Mindestrückgang des MACD-Histogramms für Shorts (Punkte) | 0.186 |
| minRangePips Die Spanne des vorherigen Bar muss diesen Wert überschreiten (Pips) | 2 |
| takeProfitPoints Gewinnziel (Punkte) | 10 |
| stopLossPoints Schutz-Stop (Punkte) | 10 |
Der Code
// ============================================================ // SuperTrend SAR MACD // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Not yet tested // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // size per point stMultiplier = 3 // SuperTrend ATR multiplier stPeriod = 5 // SuperTrend ATR length sarStart = 0.02 // Parabolic SAR start factor sarStep = 0.02 // Parabolic SAR step sarMax = 0.03 // Parabolic SAR maximum factor macdFast = 12 // MACD fast length macdSlow = 26 // MACD slow length macdLineArg = 150 // third MACDline argument, as published macdSignalPeriod = 9 // EMA of the MACD line used as signal lookbackPeriod = 100 // window for the pressure calculation pressurePeriod = 500 // EMA length that smooths buy and sell pressure minTrendBars = 15 // SuperTrend must have held its side longer than this longMacdSlope = 0.045 // minimum rise of the MACD histogram for longs (points) shortMacdSlope = 0.186 // minimum fall of the MACD histogram for shorts (points) minRangePips = 2 // previous bar range must exceed this (pips) takeProfitPoints = 10 // profit target (points) stopLossPoints = 10 // protective stop (points) ONCE stNotRisingBars = 0 // bars in a row the SuperTrend has not risen ONCE stNotFallingBars = 0 // bars in a row the SuperTrend has not fallen // --- Indicators --- stValue = SuperTrend[stMultiplier, stPeriod] sarValue = SAR[sarStart, sarStep, sarMax] macdMain = MACDline[macdFast, macdSlow, macdLineArg](close) macdTrigger = ExponentialAverage[macdSignalPeriod](MACDline[macdFast, macdSlow, macdLineArg](close)) macdHistogram = macdMain - macdTrigger barRange = Range // Buying versus selling pressure over the lookback window, smoothed. channelLow = Lowest[lookbackPeriod](low) channelHigh = Highest[lookbackPeriod](high) buyPressure = 100 * (3 * close - 2 * channelLow - open[lookbackPeriod - 1]) / CustomClose sellPressure = 100 * (open[lookbackPeriod - 1] + 2 * channelHigh - 3 * close) / CustomClose pressureSpread = ExponentialAverage[pressurePeriod](buyPressure) - ExponentialAverage[pressurePeriod](sellPressure) IF stValue[2] >= stValue[1] THEN stNotRisingBars = stNotRisingBars + 1 ELSE stNotRisingBars = 0 ENDIF IF stValue[1] >= stValue[2] THEN stNotFallingBars = stNotFallingBars + 1 ELSE stNotFallingBars = 0 ENDIF
17 weitere Zeilen: die Einstiegs- und Ausstiegsregeln.
Setup
Fragen
Der Code ist für ProOrder geschrieben, wurde aber noch nicht auf Kompilierfehler geprüft und noch nicht per Backtest getestet. Betrachten Sie ihn als Ausgangspunkt für eigene Tests.
Noch keine. Ergebnisse werden ergänzt, sobald sie die Testreihe durchlaufen hat.
Sie handelt eine Größe von 1 pro Punkt. Ohne Backtest gibt es noch keine Drawdown-Zahl, beginnen Sie daher klein im Demokonto.
Verwandt
Die ProRealAlgos Community erhält die vollständigen Regeln, den kompletten Code und das automatisierte Portfolio.