Kama & Sma Trading System DAX mtf en screener
Forums › ProRealTime forum Français › Support ProScreener › Kama & Sma Trading System DAX mtf en screener
- This topic has 2 replies, 2 voices, and was last updated 4 years ago by finplus.
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
01/12/2020 at 11:21 AM #116488Kama & Sma Trading System DAX mtf123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134//************************************************************************// Kama & Sma Trading System DAX mtf//************************************************************************//DEFPARAM CumulateOrders = FalseDEFPARAM PreLoadBars = 2000////////////////////////////////////////////////////////////////////////TIMEFRAME (default)ONCE nLots = 1ONCE LongTrading = 1 //1=allowed 0=bannedONCE ShortTrading = 1 //1=allowed 0=banned//ONCE TP = 200 //200 pipsONCE SL = 50 //50 pips//TimeForbidden = OpenTime < 090000 AND OpenTime > 190000LongCond = (Not TimeForbidden) AND LongTradingShortCond = (Not TimeForbidden) AND ShortTrading//TIMEFRAME (1 hour, updateonclose) //h1IF Not OnMarket THENBarCount = 0ELSEBarCount = BarCount + 1ENDIF//------------------------------------------------------------------------------------// Kama & Sma Strategy////https://www.forexstrategiesresources.com/trend-following-forex-strategies/111-kama-strategy///Period = 2 //2 (standard 10)FastPeriod = 2 //standardSlowPeriod = 30 //standard//Fastest = 2 / (FastPeriod + 1)Slowest = 2 / (SlowPeriod + 1)if barindex >= (Period + 1) thenNum = abs(close-close[Period])Den = summation[Period](abs(close-close[1]))ER = Num / DenAlpha = SQUARE(ER *(Fastest - Slowest )+ Slowest)Kama = (Alpha * Close) + ((1 -Alpha)* Kama[1])elseKama = closeendif//------------------------------------------------------------------------------------Sma = average[22,0](close) //22//------------------------------------------------------------------------------------a1 = Kama CROSSES OVER Sma// --- SHORTb1 = Kama CROSSES UNDER Sma////////////////////////////////////////////////////////////////////////TIMEFRAME (default) //1 minONCE TradeON = 1IF IntraDayBarIndex = 0 THENTradeON = 1ENDIFTradeBar = BarCountIF Not OnMarket AND TradeBar <> TradeBar[1] THENTradeON = 1ENDIF//************************************************************************// LONG trades//************************************************************************IF a1 AND TradeON AND LongCond THENBUY nLots CONTRACT AT MARKETTradeON = 0ENDIF//************************************************************************// SHORT trades//************************************************************************IF b1 AND TradeON AND ShortCond THENSELLSHORT nLots CONTRACT AT MARKETTradeON = 0ENDIF//SET TARGET pPROFIT TPSET STOP pLOSS SL//////////////////////////////////////////////////////////////////////////////////////////////////////////// Trailing Stop//------------------------------------------------------------------------------------IF Not OnMarket THENTrailStart = 10 //10 Start trailing profits from this pointBasePerCent = 0.100 //10.0% Profit to keepStepSize = 6 //6 Pips chunks to increase PercentagePerCentInc = 0.100 //10.0% PerCent increment after each StepSize chunkRoundTO = -0.5 //-0.5 rounds to Lower integer, +0.4 rounds to Higher integerPriceDistance = 7 * pipsize//8.9 minimun distance from current pricey1 = 0y2 = 0ProfitPerCent = BasePerCentELSIF LongOnMarket AND close > (TradePrice + (y1 * pipsize)) THEN //LONGx1 = (close - tradeprice) / pipsize //convert price to pipsIF x1 >= TrailStart THEN //go ahead only if N+ pipsDiff1 = abs(TrailStart - x1)Chunks1 = max(0,round((Diff1 / StepSize) + RoundTO))ProfitPerCent = BasePerCent + (BasePerCent * (Chunks1 * PerCentInc))ProfitPerCent = max(ProfitPerCent[1],min(100,ProfitPerCent))y1 = max(x1 * ProfitPerCent, y1) //y = % of max profitENDIFELSIF ShortOnMarket AND close < (TradePrice - (y2 * pipsize)) THEN//SHORTx2 = (tradeprice - close) / pipsize //convert price to pipsIF x2 >= TrailStart THEN //go ahead only if N+ pipsDiff2 = abs(TrailStart - x2)Chunks2 = max(0,round((Diff2 / StepSize) + RoundTO))ProfitPerCent = BasePerCent + (BasePerCent * (Chunks2 * PerCentInc))ProfitPerCent = max(ProfitPerCent[1],min(100,ProfitPerCent))y2 = max(x2 * ProfitPerCent, y2) //y = % of max profitENDIFENDIFIF y1 THEN //Place pending STOP order when y>0SellPrice = Tradeprice + (y1 * pipsize) //convert pips to priceIF abs(close - SellPrice) > PriceDistance THENIF close >= SellPrice THENSELL AT SellPrice STOPELSESELL AT SellPrice LIMITENDIFELSESELL AT MarketENDIFENDIFIF y2 THEN //Place pending STOP order when y>0ExitPrice = Tradeprice - (y2 * pipsize) //convert pips to priceIF abs(close - ExitPrice) > PriceDistance THENIF close <= ExitPrice THENEXITSHORT AT ExitPrice STOPELSEEXITSHORT AT ExitPrice LIMITENDIFELSEEXITSHORT AT MarketENDIFENDIF
Bonjour,
j’ai trouvé ce code sur le site (codé par Roberto Gozzi). Est il possible d’en avoir un screener SVP?
merci d’avance.
01/12/2020 at 12:06 PM #116492Voilà (pas testé):
123456789101112131415161718192021222324252627282930// Kama & Sma//Period = 2 //2 (standard 10)FastPeriod = 2 //standardSlowPeriod = 30 //standard//Fastest = 2 / (FastPeriod + 1)Slowest = 2 / (SlowPeriod + 1)if barindex >= (Period + 1) thenNum = abs(close-close[Period])Den = summation[Period](abs(close-close[1]))ER = Num / DenAlpha = SQUARE(ER *(Fastest - Slowest )+ Slowest)Kama = (Alpha * Close) + ((1 -Alpha)* Kama[1])elseKama = closeendif//------------------------------------------------------------------------------------Sma = average[22,0](close) //22//------------------------------------------------------------------------------------a1 = Kama CROSSES OVER Sma// --- SHORTb1 = Kama CROSSES UNDER Smax = 0If a1 thenx = 1Elsif b1 thenx = 2EndifScreener[x]Ici vous trouverez l’indicateur: https://www.prorealcode.com/topic/kama-sma-trading-system-dax-mtf/#post-116055
1 user thanked author for this post.
01/14/2020 at 12:21 PM #116772 -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
Find exclusive trading pro-tools on
Similar topics: