How to hide code for my trading strategy to be used by others
Forums › ProRealTime English forum › ProOrder support › How to hide code for my trading strategy to be used by others
- This topic has 8 replies, 3 voices, and was last updated 3 years ago by Nicolas.
-
-
08/14/2020 at 7:57 AM #141579
Hi
I am a new member 🙂
I have coded for 2 years now.
My result is up and down.
I have done a code that I want to send to my friends but I don’t want them to see my code.
I read that I can hide indicators in the code but I don’t know how.
For example, here is a code from library.
How can you hide as much as possible from this example code.
Can I do the whole code as an indicator an encrypt it, except trailing SL?
Best regards Sean
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134//************************************************************************// 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 MarketENDIFENDIF08/14/2020 at 8:01 AM #141580ProOrder code must remains visible (not hidden). So the workaround is to use hidden indicator(s) that deals with the trading signals, that are CALLed by the strategy.
Of course, all orders management and instructions only compatible with ProOrder must remain in the strategy, so there is always a visible part on how you manage orders.
08/14/2020 at 8:18 AM #141589Thanks for replay Nicolas
I’m not that good at this.
What would the example code look like if you were to hide as much as possible.
It’s easier easier to understand with an example 🙂
08/14/2020 at 8:37 AM #141598Never used a CALL in 2 years of coding? 😉
Anyway, just a quick example:
My strategy is an RSI crossing the level 50, it generates a return variable of 1 = buy and -1 = sellshort.
strategy is contained in an indicator1234567891011a = rsi[14]signal = 0if a crosses over 50 thensignal = 1elsif a crosses under 50 thensignal = -1endifreturn signalNow in your ProOrder code, make a CALL of this indicator:
the ProOrder strategy123456789signal = CALL "my-indicator-signal"if signal = 1 thenbuy at marketendifif signal = -1 thensellshort at marketendif2 users thanked author for this post.
08/14/2020 at 8:42 AM #141599Thank you Nicolas
Now I understand better 🙂
08/14/2020 at 9:01 AM #14160408/14/2020 at 9:08 AM #141605True so I suggest exporting the hidden indicator as a standalone itf file and send the strategy as a text file, in order to get rid or any ‘error’..
Anyway, this process will be greatly improved with the marketplace (no export anymore, automatic installation, automatic update, ..). If you want to be featured as a seller, you can contact me at market[at]prorealcode.com
08/14/2020 at 9:53 AM #14160908/14/2020 at 10:59 AM #141617 -
AuthorPosts
Find exclusive trading pro-tools on