TheStrat – full tf continuity
Forums › ProRealTime English forum › ProOrder support › TheStrat – full tf continuity
- This topic has 6 replies, 2 voices, and was last updated 2 years ago by
ullle73.
-
-
01/01/2023 at 4:20 PM #206600
Im looking to create my own system thats based on TheStrat and “full timeframe continuity” meaning, the more TF that are in the same directions, the better. Pure priceaction system that seems very popular.
If anyone could help me code the following:
- Timeframes: 1m, 5m, 15m, 30m, 1h, 4h, Daily, Weekly, Monthly (would love to have an option to turn on/off every single TF, to be able to backtest different combos of TF) if not possible, use Monthly, Weekly, Daily and 1h
- When selected TF have the same candle color, go long/short
- SL: x, TP: y
- Optional trendfilter, above/below ma200 on daily (prefered to code a turn on/off option)
- If possible to use this MM system below: (prefered to code a turn on/off option for MM) else standard size 1 lot
- Time filter, trade only between 090000 and 173000
mm12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849once os = 1 //ordersize - can be any number depending on account size.once osa = osonce kax = 15 //15once teilung = 2 //1.5 reducing the ordersize after winning trade//once zl=2 // 2 Ziellevel. Quadrant wird in zl Teile geteilt, je weniger, desto höher das Ziel//once mgr=60 // 40 Mindestgröße des Channelsonce ff = twice //2.5 increasing ordersize after losing trade. (for first 2 consecutive losses)once ff2 = third //1.2 times the size after the THIRD consecutive LOSSonce ff3 = fourth //1.4 times the size after the FOURTH consecutive LOSSonce ff4 = fifth //1.7 times the size after the FIFTH consecutive LOSS (beyond 5 losses, stop increasing)once maxcon = 50// defing the maximum ordersizeonce losses = 0if strategyprofit>sp then // and if equity reaches maximum again.os = osasp = strategyprofitendifstart=0endifif strategyprofit<strategyprofit[1] then // increasing ordersize when losinglosses = losses + 1IF losses <= 2 thenos = os * ffelsif losses = 3 thenos = os * ff2elsif losses = 4 thenos = os * ff3elsif losses = 5 thenos = os * ff4endif//if os>maxcon then//os=maxcon//endifos = min(os,maxcon)endifstart = 1endifif strategyprofit>strategyprofit[1] then // decreasing ordersize when winninglosses = 0start = 1os = 1 //teilung//if os<osa then//os=osa//endifos = max(osa,os)endif01/01/2023 at 7:37 PM #206612You can use at most 6 different TFs in your code, so in your case you will have to drop 3 of those you mentionned, then duplicate the strategy and replace three TFs with the missing ones.
I’ll code it asap.
Which are the prefered 6 timeframes you want to start with?
1 user thanked author for this post.
01/01/2023 at 8:33 PM #20662101/03/2023 at 11:55 AM #206720There you go:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109DEFPARAM CumulateOrders = False//Timeframe(Monthly,UpdateOnClose)BullishM = close > openBearishM = close < open//Timeframe(Weekly,UpdateOnClose)BullishW = close > openBearishW = close < open//Timeframe(Daily,UpdateOnClose)BullishD = close > openBearishD = close < openma200 = average[200,0](close)//Timeframe(1h,UpdateOnClose)Bullish1H = close > openBearish1H = close < open//Timeframe(15mn,UpdateOnClose)Bullish15 = close > openBearish15 = close < open//Timeframe(5mn,UpdateOnClose)Bullish5 = close > openBearish5 = close < open//Timeframe(default)//TimeCond = time >= 090000 AND time <= 173000//// replace OR 0 with OR 1 to disable one or more conditions//LongCond = TimeCond OR 0LongCond = LongCond AND BullishM OR 0LongCond = LongCond AND BullishW OR 0LongCond = LongCond AND BullishD OR 0LongCond = LongCond AND Bullish1H OR 0LongCond = LongCond AND Bullish15 OR 0LongCond = LongCond AND Bullish5 OR 0LongCond = LongCond AND close > ma200 OR 0//ShortCond = TimeCond OR 0ShortCond = ShortCond AND BearishM OR 0ShortCond = ShortCond AND BearishW OR 0ShortCond = ShortCond AND BearishD OR 0ShortCond = ShortCond AND Bearish1H OR 0ShortCond = ShortCond AND Bearish15 OR 0ShortCond = ShortCond AND Bearish5 OR 0ShortCond = ShortCond AND close < ma200 OR 0//ONCE SL = 20ONCE TP = SL * 6//once os = 1 //ordersize - can be any number depending on account size.once osa = osonce kax = 15 //15once teilung = 2 //1.5 reducing the ordersize after winning trade//once zl=2 // 2 Ziellevel. Quadrant wird in zl Teile geteilt, je weniger, desto höher das Ziel//once mgr=60 // 40 Mindestgröße des Channelsonce ff = 2.5//twice //2.5 increasing ordersize after losing trade. (for first 2 consecutive losses)once ff2 = 1.2//third //1.2 times the size after the THIRD consecutive LOSSonce ff3 = 1.4//fourth //1.4 times the size after the FOURTH consecutive LOSSonce ff4 = 1.7//fifth //1.7 times the size after the FIFTH consecutive LOSS (beyond 5 losses, stop increasing)once maxcon = 50// defing the maximum ordersizeonce losses = 0if strategyprofit>sp then // and if equity reaches maximum again.os = osasp = strategyprofitendifstart=0if strategyprofit<strategyprofit[1] then // increasing ordersize when losinglosses = losses + 1IF losses <= 2 thenos = os * ffelsif losses = 3 thenos = os * ff2elsif losses = 4 thenos = os * ff3elsif losses = 5 thenos = os * ff4endif//if os>maxcon then//os=maxcon//endifos = min(os,maxcon)endifstart = 1if strategyprofit>strategyprofit[1] then // decreasing ordersize when winninglosses = 0start = 1os = 1 //teilung//if os<osa then//os=osa//endifos = max(osa,os)endif//IF LongCond AND Not OnMarket THEN //use Not LongOnMarket to Stop & ReverseBUY os CONTRACTS AT MARKETENDIFIF ShortCond AND Not OnMarket THEN //use Not ShortOnMarket to Stop & ReverseSELLSHORT os CONTRACTS AT MARKETENDIF//SET STOP pLOSS SLSET TARGET pPROFIT TP01/03/2023 at 11:53 PM #206737Wow, perfect Roberto! thanks alot! 😀
Could i ask for you to add two different entry criterias? option to activate or deactivate like you did with the different timeframs.
Entry #1: when the lowest TF cross over/under ema5
Entry #2: when rsi3 cross over 30/under 70
01/04/2023 at 12:46 PM #206765Timeframes cannot be used with options to enable/disable them. You have two choices:
- disable the timeframe by adding two leading backslashes on that line
- changing the value of the timeframe (say change DAILY to 4H, still leaving variables unchanged if you prefer).
Entry #1 and #2 are to be both met on the lowest TF?
The two new conditions are to be added or shall they replace the existing Bullish/Bearish condition?
1 user thanked author for this post.
01/04/2023 at 7:39 PM #206802i see, but i can set 1 on long cond (line 36) to disable weekly bias right?
when Monthly, Weekly, Daily, 1h, m15 and m5 are green, buy when rsi3 cross above 30 or price cross above ema5 on m5 TF
reverse for shorts. 70 level for short on rsi.
thanks roberto!!
-
AuthorPosts
Find exclusive trading pro-tools on