TF différents entre indicateur et stratégie
Forums › ProRealTime forum Français › Support ProOrder › TF différents entre indicateur et stratégie
- This topic has 8 replies, 3 voices, and was last updated 9 months ago by bertrandpinoy. 
- 
	
		
- 
		
			
				
01/21/2025 at 7:20 PM #242931Bonsoir, Je souhaite pouvoir mettre en œuvre des back test opérant sur une stratégie de type “call”. J’ai besoin des données de l indicateur en 4H et de faire fonctionner mon BT sur un graphique 5 min par exemple. est-ce possible et si oui comment? merci d’avance. 01/22/2025 at 11:06 AM #242942Holà ! vous pouvez faire ce qui suit: 123456789101112131415timeframe(4h,updateonclose)val= CALL "yourIndicator"setup4h=yourconditions4Htimeframe(5mn)setup5MN=yourconditions5mnif setup5MN and setup4H thenbuy 1 contract at marketset stop %loss 4set target %profit 4endif//This will show you how works your indicator in 4Hgraph val coloured("red")01/22/2025 at 7:56 PM #242967Bonsoir Ivan, merci. Malgré votre aide je n y parviens pas. pouvez vous aider encore ? Voici la stratégie en question : //STRATEGIE CALL BOTTOM est une strategie d achat avec crosses under. TF strategie 5 min. TF indicateur 4h DEFPARAM CumulateOrders = False // Une seule position à la fois //TIMEFRAME(default) doit etre un TF4H 
 // Variables pour récupérer les 20 niveaux “clé” renvoyés par l’indicateur
 Top1 = 0
 Top2 = 0
 Top3 = 0
 Top4 = 0
 Top5 = 0
 Top6 = 0
 Top7 = 0
 Top8 = 0
 Top9 = 0
 Top10 = 0
 Top11 = 0
 Top12 = 0
 Top13 = 0
 Top14 = 0
 Top15 = 0
 Top16 = 0
 Top17 = 0
 Top18 = 0
 Top19 = 0
 Top20 = 0
 TopCount = 0 // Nombre total de niveaux renvoyés par l’indicateur// Appel de l’indicateur pour récupérer les niveaux “TOP” 
 Top1, Top2, Top3, Top4, Top5, Top6, Top7, Top8, Top9, Top10,Top11, Top12, Top13, Top14, Top15, Top16, Top17, Top18, Top19, Top20, TopCount = CALL “call BOTTOM”//Doit etre en TF5min // Vérification des croisements sous les niveaux “TOP” 
 IF TopCount > 0 THEN
 // Parcours des 20 niveaux “TOP” pour détecter un croisement
 IF close CROSSES UNDER Top1 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top2 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top3 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top4 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top5 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top6 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top7 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top8 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top9 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top10 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top11 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top12 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top13 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top14 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top15 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top16 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top17 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top18 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top19 THEN
 buy 1 CONTRACT AT MARKET
 ELSIF close CROSSES UNDER Top20 THEN
 buy 1 CONTRACT AT MARKET
 endif
 endifTIMEFRAME(default) 
 // Take Profit Logic with Trailing Stop and Two Partial Closures
 SET TARGET pPROFIT 100partialTakeProfit = 50 * pipsize // First TP level for partial closure 
 securedProfitAfterTP = 25 * pipsize // Second TP level to secure minimal profit
 trailingstart = 55 // Trailing stop starts at 55 pips of profit
 trailingstep =35 // Trailing stop moves by 35 pips increments// Reset stoploss and partial closure indicators 
 IF NOT ONMARKET THEN
 newSL = 0
 isPartialProfitTaken = 0 // Indicator for first partial closure
 entryPrice = 0 // Initial entry price
 MAXPRICE = 0 // Reset maximum price reached
 ENDIF// Manage long positions 
 IF LONGONMARKET THEN
 // Record initial entry price when position is opened
 IF entryPrice = 0 THEN
 entryPrice = tradeprice(1)
 ENDIF// Track maximum price reached since entry 
 MAXPRICE = MAX(MAXPRICE, close)// First partial closure at 50 pips 
 IF isPartialProfitTaken = 0 AND close – entryPrice >= partialTakeProfit THEN
 SELL 0.5 CONTRACT AT MARKET // Sell 0.5 contract
 isPartialProfitTaken = 1 // Mark that the first partial closure has been taken
 ENDIF// Second partial closure to secure +2.5 pips profit 
 IF isPartialProfitTaken = 1 AND close <= entryPrice + securedProfitAfterTP THEN
 SELL AT MARKET // Close remaining position at +2.5 pips profit
 isPartialProfitTaken = 0 // Reset the indicator
 ENDIF// Trailing stop logic 
 // Start trailing stop attrailingstartpips of profit
 IF newSL = 0 AND close – entryPrice >= trailingstart * pipsize THEN
 newSL = entryPrice + trailingstep * pipsize // Set initial trailing stop level
 ENDIF// Move trailing stop up by trailingstepevery time the price reaches a new profit level
 IF newSL > 0 AND close – newSL >= trailingstep * pipsize THEN
 newSL = newSL + trailingstep * pipsize
 ENDIF
 ENDIF// Stop order to exit long position if trailing stop is hit 
 IF newSL > 0 THEN
 SELL AT newSL STOP
 ENDIF
 //************************************************************************01/22/2025 at 8:04 PM #24296801/22/2025 at 8:31 PM #242969Bonsoir @fifi743 dans mon cas la strategie doit utiliser crosses under meme si c est un achat, car le prix doit venir du bas 01/22/2025 at 8:38 PM #24297001/22/2025 at 8:51 PM #242971Oui merci encore de vous intéressé a mon dossier . si j utilise crosses over j’obtiens 0 trade. Avec crosses under voir image jointe. C est un BT sans variables. 01/23/2025 at 10:34 AM #24297501/23/2025 at 10:56 AM #242977Ok,merci. Vous allez revenir vers moi avec une version exploitable du coup? 
- 
		AuthorPosts
			Find exclusive trading pro-tools on 



 
		 
		 
		