Instruction CALL en MTF

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #197819 quote
    wtangsiri
    Participant
    Junior

    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 cordialement

    Voici l’intégrité de ce programme en question :

    DefParam CumulateOrders = False // Cumul des positions désactivé
    DefParam Preloadbars = 15000
    //----- Function : STOP SUIVEUR -----
    Once TrailingStart = 10 //Mon Seuil de déclenchement
    
    Once MyNewSL = 0
    Once MyFlagSL = 1 // Flag Stop Loss
    Once MyExitBar = 0
    Once MyStoKCross = 0
    
    //--- Optimisation en cas de perte ---
    Once MyComptageGainLatent = 0
    Once 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 Optimisation
    
    MyWorkDayIsValid = CurrentDayOfWeek >= 1 and CurrentDayOfWeek <= 5
    
    TimeFrame(60 Minutes)
    My60MnMACD = MACD[12,26,15](Close)
    
    TimeFrame(30 Minutes)
    //----- Super Trend -----
    My30MnSuperTrend = Supertrend[3,3]
    My30MnSuperTrendGreen = Close > My30MnSuperTrend
    My30MnSuperTrendRed = 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 > 0
    My30MnMACDRed = My30MnMACD < 0
    //---- STOCHASTIC ----
    My30MnStoK=Stochastic[14,3](close)
    My30MnStoD=Average[5](My30MnStoK)
    
    TimeFrame(15 Minutes)
    //----- MACD -----
    My15MnMACD = MACD[12,26,15](Close)
    My15MnMACDGreen = My15MnMACD > 0
    My15MnMACDRed = My15MnMACD < 0
    //---- STOCHASTIC ----
    My15MnStoK=Stochastic[14,3](close)
    My15MnStoD=Average[5](My15MnStoK)
    
    TimeFrame(Default)
    //----- Super Trend -----
    MySuperTrend = Supertrend[3, 25]
    MySuperTrendGreen = Close > MySuperTrend
    MySuperTrendRed = Close < MySuperTrend
    //----- MACD -----
    MyDefaultMACD = MACD[12,26,15](Close)
    MyDefaultMACDGreen = MyDefaultMACD > 0
    MyDefaultMACDRed = MyDefaultMACD < 0
    
    //---- STOCHASTIC ----
    MyDefaultStoK=Stochastic[14,3](close)
    MyDefaultStoD=Average[5](MyDefaultStoK)
    MyDefaultStoDiffForLong = MyDefaultStoK - MyDefaultStoD
    
    //=================== Debut Programme ===================
    If MyWorkDayIsValid then
    //--- Entry Conditions ---
    MyEntryCond4 = MyDefaultStoDiffForLong > 4
    MyEntryCond4x= MyDefaultStoK < 85
    
    MyEntryCond5 = MyDefaultMACD[0] > 0
    MyEntryCond5a= My15MnMACD > 2
    MyEntryCond5b= My30MnMACD > 2
    
    MyEntryCond7b= My30MnSuperTrendGreen
    
    MyEntryCond9 = (CurrentTime > 080000 And CurrentTime < 151000) Or (CurrentTime > 154000 And CurrentTime < 203000)
    
    
    
    
    If (MyDefaultStoK Crosses Over MyDefaultStoD) And Not OnMarket then
    MyStoKCross = 1
    Endif
    MyEntryCond14 = MyDefaultStoK > MyDefaultStoD And MyStoKCross = 1
    MyEntryCond14a= My15MnStoK > My15MnStoD
    MyEntryCond14b= My30MnStoK > My30MnStoD
    
    
    
    
    MyEntryCondForLongIsOK = MyEntryCond14 And MyEntryCond9 And MyEntryCond4 And MyEntryCond4 And MyEntryCond5 And MyEntryCond5a And MyEntryCond5b
    //--- Exit Conditions ---
    
    MyExitCond4b= My30MnMACDRed
    
    MyExitCond14b= My30MnStoK Crosses Under My30MnStoD
    
    MyExitCondForLongIsOK = MyExitCond4b
    
    //----- LONG et Initialisation du SL -----
    If Not OnMarket then
    MyNewSL = 0
    Endif
    
    //----- LONG et Initialisation du SL -----
    If MyEntryCondForLongIsOK then
    Buy 1 LOT AT Market
    MyGainLatent = 0
    MyNewSL = 0
    MyStoKCross = 0
    MyExitType = 0
    Endif
    
    //----- 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 Then
    MyNewSL = TradePrice(1) + 4
    Endif
    //--- Les pas suivants : Incrémentation ---
    MyDiffForLong = Close - Close[1]
    
    If MyNewSL>0 And MyNewSL <= MySuperTrend Then
    MyNewSL = MySuperTrend
    Endif
    
    //----- Gestion des sorties de positions -----
    If MyNewSL > 0 Then
    Sell AT MyNewSL STOP
    MyExitBar = BarIndex
    MyExitType=3
    Endif
    Endif
    
    If MyExitCondForLongIsOK Or MyGainLatent >=250 then
    
    If MyOptimyzer then
    If MyGainLatent < 0 And My60MnMACD > 1 then
    MyFlagSL = 1
    MyExitType=6
    Else
    Sell At Market
    MyExitType=9
    Endif
    Else
    Sell At Market
    MyExitType=12
    Endif
    //=== End Exit Condition ===
    Endif
    Endif
    //=== 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"
    Capture-1.jpg Capture-1.jpg
    #198256 quote
    whbh
    Participant
    New

    Je crois que l’instruction CALL bugge

    C’est la raison pour laquelle ProRealTime sort sa version 12

     

    J’ai aussi des problèmes de CALL non résolus

    #198285 quote
    wtangsiri
    Participant
    Junior

    Bonjour 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 MyEntryCond5a

    If MyEntryCondForLongIsOK  then
    Buy 1 contract
    Endif

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Instruction CALL en MTF


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
wtangsiri @wtangsiri Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by wtangsiri
3 years, 7 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 07/23/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...