Instruction CALL en MTF
Forums › ProRealTime forum Français › Support ProBuilder › Instruction CALL en MTF
- This topic has 2 replies, 2 voices, and was last updated 2 years ago by
wtangsiri.
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
07/23/2022 at 9:00 PM #197819
Bonjour Nicolas,
Je souhaiterais convertir ce programme avec l’instruction CALL afin de protéger mon code
Comment dois je procéder pour scinder en 2 parties, une en indicateur protégé (pour cacher le code) et l’autre partie en programme
Merci d’avance !
Bien cordialementVoici l’intégrité de ce programme en question :
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168DefParam CumulateOrders = False // Cumul des positions désactivéDefParam Preloadbars = 15000//----- Function : STOP SUIVEUR -----Once TrailingStart = 10 //Mon Seuil de déclenchementOnce MyNewSL = 0Once MyFlagSL = 1 // Flag Stop LossOnce MyExitBar = 0Once MyStoKCross = 0//--- Optimisation en cas de perte ---Once MyComptageGainLatent = 0Once MyOptimyzer = 1 //Optimiseur en cas de Perte//----- Function : STOP SUIVEUR -----//Set Stop $Loss 200//MyExitType = 3 : Vente en Stop Gain sans Optimisation//MyExitType = 6 : Vente en Stop Gain après Optimisation//MyExitType = 9 : Vente au marché après Optimisation//MyExitType = 12 : Vente Normale au marché sans OptimisationMyWorkDayIsValid = CurrentDayOfWeek >= 1 and CurrentDayOfWeek <= 5TimeFrame(60 Minutes)My60MnMACD = MACD[12,26,15](Close)TimeFrame(30 Minutes)//----- Super Trend -----My30MnSuperTrend = Supertrend[3,3]My30MnSuperTrendGreen = Close > My30MnSuperTrendMy30MnSuperTrendRed = Close < My30MnSuperTrend//----- RSI -----My30MnRsi2 = RSI[2](Close)My30MnRsi7 = RSI[7](Close)//----- MACD -----My30MnMACDLine = MACDLine[12,26,15](Close)My30MnMACDSignal = MACDSignal[12,26,15](Close)My30MnMACD = MACD[12,26,15](Close)My30MnMACDGreen = My30MnMACD > 0My30MnMACDRed = My30MnMACD < 0//---- STOCHASTIC ----My30MnStoK=Stochastic[14,3](close)My30MnStoD=Average[5](My30MnStoK)TimeFrame(15 Minutes)//----- MACD -----My15MnMACD = MACD[12,26,15](Close)My15MnMACDGreen = My15MnMACD > 0My15MnMACDRed = My15MnMACD < 0//---- STOCHASTIC ----My15MnStoK=Stochastic[14,3](close)My15MnStoD=Average[5](My15MnStoK)TimeFrame(Default)//----- Super Trend -----MySuperTrend = Supertrend[3, 25]MySuperTrendGreen = Close > MySuperTrendMySuperTrendRed = Close < MySuperTrend//----- MACD -----MyDefaultMACD = MACD[12,26,15](Close)MyDefaultMACDGreen = MyDefaultMACD > 0MyDefaultMACDRed = MyDefaultMACD < 0//---- STOCHASTIC ----MyDefaultStoK=Stochastic[14,3](close)MyDefaultStoD=Average[5](MyDefaultStoK)MyDefaultStoDiffForLong = MyDefaultStoK - MyDefaultStoD//=================== Debut Programme ===================If MyWorkDayIsValid then//--- Entry Conditions ---MyEntryCond4 = MyDefaultStoDiffForLong > 4MyEntryCond4x= MyDefaultStoK < 85MyEntryCond5 = MyDefaultMACD[0] > 0MyEntryCond5a= My15MnMACD > 2MyEntryCond5b= My30MnMACD > 2MyEntryCond7b= My30MnSuperTrendGreenMyEntryCond9 = (CurrentTime > 080000 And CurrentTime < 151000) Or (CurrentTime > 154000 And CurrentTime < 203000)If (MyDefaultStoK Crosses Over MyDefaultStoD) And Not OnMarket thenMyStoKCross = 1EndifMyEntryCond14 = MyDefaultStoK > MyDefaultStoD And MyStoKCross = 1MyEntryCond14a= My15MnStoK > My15MnStoDMyEntryCond14b= My30MnStoK > My30MnStoDMyEntryCondForLongIsOK = MyEntryCond14 And MyEntryCond9 And MyEntryCond4 And MyEntryCond4 And MyEntryCond5 And MyEntryCond5a And MyEntryCond5b//--- Exit Conditions ---MyExitCond4b= My30MnMACDRedMyExitCond14b= My30MnStoK Crosses Under My30MnStoDMyExitCondForLongIsOK = MyExitCond4b//----- LONG et Initialisation du SL -----If Not OnMarket thenMyNewSL = 0Endif//----- LONG et Initialisation du SL -----If MyEntryCondForLongIsOK thenBuy 1 LOT AT MarketMyGainLatent = 0MyNewSL = 0MyStoKCross = 0MyExitType = 0Endif//----- Gestion des sorties de positions -----If OnMarket Then//----- Comptage Gain Latent -----MyGainLatent = (Close - TradePrice(1))//----- Comptage Gain Latent -----If MyFlagSL then//----- Pose du Stop Loss -----//--- 1er pas : La Mise à BE ---If MyNewSL=0 And (Close - TradePrice(1)) >= TrailingStart ThenMyNewSL = TradePrice(1) + 4Endif//--- Les pas suivants : Incrémentation ---MyDiffForLong = Close - Close[1]If MyNewSL>0 And MyNewSL <= MySuperTrend ThenMyNewSL = MySuperTrendEndif//----- Gestion des sorties de positions -----If MyNewSL > 0 ThenSell AT MyNewSL STOPMyExitBar = BarIndexMyExitType=3EndifEndifIf MyExitCondForLongIsOK Or MyGainLatent >=250 thenIf MyOptimyzer thenIf MyGainLatent < 0 And My60MnMACD > 1 thenMyFlagSL = 1MyExitType=6ElseSell At MarketMyExitType=9EndifElseSell At MarketMyExitType=12Endif//=== End Exit Condition ===EndifEndif//=== End WorkDay ===Endif//GraphOnPrice MyNewSL Coloured(0, 0, 0) As "My NewSL"//GraphOnPrice MyHLDiff Coloured(255,82,82) As "My High Low Diff"//Graph MyStoKCross Coloured(255,82,82) As "MyStoKCross"//Graph MyExitType Coloured(255,82,82) As "MyExitType"07/31/2022 at 8:28 PM #19825608/01/2022 at 1:53 PM #198285Bonjour tout le monde
Peut-être, en simplifiant les instructions, c’est plus facile à lire pour le forum
TimeFrame(15 Minutes)
//—– MACD —–
My15MnMACD = MACD[12,26,15](Close)TimeFrame(Default)
//—– MACD —–
MyDefaultMACD = MACD[12,26,15](Close)MyEntryCond5 = MyDefaultMACD > 0
MyEntryCond5a= My15MnMACD > 5
MyEntryCondForLongIsOK = MyEntryCond5 And MyEntryCond5aIf MyEntryCondForLongIsOK then
Buy 1 contract
Endif -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
Find exclusive trading pro-tools on
Similar topics: