Breakout 2 ème signal
- This topic has 0 replies, 1 voice, and was last updated 7 years ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
Similar topics:
Forums › ProRealTime forum Français › Support ProOrder › Breakout 2 ème signal
Ci-dessous une demande qui a été envoyée à ProRealTime :
Bonjour,
J’ai trouvé sur votre site “prorealcode” le systeme “Dow Breakout 15min” à l’adresse suivante :
https://www.prorealcode.com/prorealtime-trading-strategies/dow-breakout-15min/
J’aurais besoin d’aide car je souhaiterais n’entrer sur le marché qu’a partir du 2eme signal (ou plus) généré par ce systeme (donc eviter systematiquement le 1er trade).
Je souhaiterais que l’entree sur le marché, lors du 1er breakout (il y a dans ce systeme plusieurs breakout possibles pendant la seance), ne soit pas effectuee.
Mais que si le breakout se reproduit dans le sens opposé, une position soit ouverte.
Par exemple le stop d’achat est touché a 17h (1er breakout de la seance) : la position longue n’est pas prise.
Par contre si le 2eme ordre de breakout est touché, short cette fois ci, l’ordre sera pris.
Et une proposition de réponse :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
// We do not store datas until the system starts. // If it is the first day that the system is launched and if it is afternoon, // it will be waiting until the next day for defining sell and buy orders //UK TIME ZONE DEFPARAM PreLoadBars = 0 // Position is closed at 20:30 DEFPARAM FlatAfter = 203000 // No new position will be initiated after the 19:45 candlestick. LimitHour = 200000 // Market scan begin with the 15 minute candlestick that closed at 15:30 StartHour = 151500 // The 24th and 31th days of December will not be traded because market close before 7h45 PM IF (Month = 5 AND Day = 1) OR (Month = 12 AND (Day = 24 OR Day = 25 OR Day = 26 OR Day = 30 OR Day = 31)) THEN TradingDay = 0 ELSE TradingDay = 1 ENDIF // Variables that would be adapted to your preferences if time = 144500 then //PositionSize = max(1,1+ROUND((strategyprofit-1000)/1000)) //gain re-invest trade volume PositionSize = 1 //constant trade volume over the time endif MaxAmplitude = 160 MinAmplitude = 20 OrderDistance = 4 PourcentageMin = 35 // Variable initilization once at system start ONCE StartTradingDay = -1 // Variables that can change in intraday are initiliazed // at first bar on each new day IF (Time <= StartHour AND StartTradingDay <> 0) OR IntradayBarIndex = 0 THEN BuyTreshold = 0 SellTreshold = 0 BuyPosition = 0 SellPosition = 0 StartTradingDay = 0 sens=0 ELSIF Time >= StartHour AND StartTradingDay = 0 AND TradingDay = 1 THEN // We store the first trading day bar index DayStartIndex = IntradayBarIndex StartTradingDay = 1 ELSIF StartTradingDay = 1 AND Time <= LimitHour THEN // For each trading day, we define each 15 minutes // the higher and lower price value of the instrument since StartHour // until the buy and sell tresholds are not defined IF BuyTreshold = 0 OR SellTreshold = 0 THEN HighLevel = Highest[IntradayBarIndex - DayStartIndex + 2](High) LowLevel = Lowest [IntradayBarIndex - DayStartIndex + 2](Low) // Spread calculation between the higher and the // lower value of the instrument since StartHour DaySpread = HighLevel - LowLevel // Minimal spread calculation allowed to consider a significant price breakout // of the higher and lower value MinSpread = DaySpread * PourcentageMin / 100 // Buy and sell tresholds for the actual if conditions are met IF DaySpread <= MaxAmplitude THEN IF SellTreshold = 0 AND (Close - LowLevel) >= MinSpread THEN SellTreshold = LowLevel + OrderDistance ENDIF IF BuyTreshold = 0 AND (HighLevel - Close) >= MinSpread THEN BuyTreshold = HighLevel - OrderDistance ENDIF ENDIF ENDIF // Creation of the buy and sell orders for the day // if the conditions are met IF SellTreshold > 0 AND BuyTreshold > 0 AND (BuyTreshold - SellTreshold) >= MinAmplitude THEN if sens<> 1 and high>BuyTreshold then sens=-1 elsif sens <>-1 and low < SellTreshold then sens=1 endif IF BuyPosition = 0 THEN IF LongOnMarket THEN BuyPosition = 1 ELSif sens=1 then BUY PositionSize CONTRACT AT BuyTreshold STOP ENDIF ENDIF IF SellPosition = 0 THEN IF ShortOnMarket THEN SellPosition = 1 ELSif sens=-1 then SELLSHORT PositionSize CONTRACT AT SellTreshold STOP ENDIF ENDIF ENDIF ENDIF // Conditions definitions to exit market when a buy or sell order is already launched IF LongOnMarket AND ((Time <= LimitHour AND SellPosition = 1) OR Time > LimitHour) THEN SELL AT SellTreshold STOP ELSIF ShortOnMarket AND ((Time <= LimitHour AND BuyPosition = 1) OR Time > LimitHour) THEN EXITSHORT AT BuyTreshold STOP ENDIF // Maximal risk definition of loss per position // in case of bad evolution of the instrument price SET STOP PLOSS MaxAmplitude //SET TAGRGET PPROFIT //70 //160 |
Find exclusive trading pro-tools on