Maurizio-Ciullo

Indicatore Set Exit On Close If Not Min Profit

Jan 22nd, 2026
56
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                                                
  2.                                     // ============================================================
  3.                                     // INDICATORE SET EXIT ON CLOSE IF NOT MIN PROFIT //
  4.                                     // ============================================================
  5.  
  6.  
  7.                                     // ============================
  8.                                     // USCITA LONG A FINE SESSIONE SE MOVIMENTO MINIMO NON RAGGIUNTO
  9.                                     // ============================
  10.  
  11. // ============================
  12. // LONG: aggiorna massimo intratrade candela per candela
  13. // ============================
  14. Inputs: MinTriggerLong(600);
  15. Vars: MaxPriceDuringTrade(0);
  16.  
  17. // Aggiorna massimo intratrade
  18. If MarketPosition = 1 Then Begin
  19.     If MaxPriceDuringTrade = 0 Then
  20.         MaxPriceDuringTrade = EntryPrice;  // inizializza al prezzo di entrata
  21.  
  22.     If High > MaxPriceDuringTrade Then
  23.         MaxPriceDuringTrade = High;
  24. End;
  25.  
  26. // ============================
  27. // FINE SESSIONE: esci se movimento minimo non raggiunto
  28. // ============================
  29. // Qui puoi chiamare questo blocco dal tuo SetExitOnClose già attivo a fine sessione
  30. // oppure in un evento di fine sessione
  31. If MarketPosition = 1 Then Begin
  32.     // massimo profitto intratrade = massimo prezzo intratrade - EntryPrice
  33.     If (MaxPriceDuringTrade - EntryPrice) * BigPointValue < MinTriggerLong Then
  34.         SetExitOnClose;
  35. End;
  36.  
  37. // ============================
  38. // RESET variabile alla chiusura trade
  39. // ============================
  40. If MarketPosition = 0 Then
  41.     MaxPriceDuringTrade = 0;
  42.  
  43.                                     // ============================
  44.                                     // USCITA SHORT A FINE SESSIONE SE MOVIMENTO MINIMO NON RAGGIUNTO
  45.                                     // ============================
  46.  
  47. // ============================
  48. // USCITA SHORT A FINE SESSIONE SE MOVIMENTO MINIMO NON RAGGIUNTO
  49. // ============================
  50.  
  51. // ============================
  52. // SHORT: aggiorna minimo intratrade candela per candela
  53. // ============================
  54. Inputs: MinTriggerShort(600);
  55. Vars: MinPriceDuringTrade(0);
  56.  
  57. // Aggiorna minimo intratrade
  58. If MarketPosition = -1 Then Begin
  59.     If MinPriceDuringTrade = 0 Then
  60.         MinPriceDuringTrade = EntryPrice;  // inizializza al prezzo di entrata
  61.  
  62.     If Low < MinPriceDuringTrade Then
  63.         MinPriceDuringTrade = Low;
  64. End;
  65.  
  66. // ============================
  67. // FINE SESSIONE: esci se movimento minimo non raggiunto
  68. // ============================
  69. // Qui puoi chiamare questo blocco dal tuo SetExitOnClose già attivo a fine sessione
  70. // oppure in un evento di fine sessione
  71. If MarketPosition = -1 Then Begin
  72.     // massimo profitto intratrade = EntryPrice - minimo intratrade
  73.     If (EntryPrice - MinPriceDuringTrade) * BigPointValue < MinTriggerShort Then
  74.         SetExitOnClose;
  75. End;
  76.  
  77. // ============================
  78. // RESET variabile alla chiusura trade
  79. // ============================
  80. If MarketPosition = 0 Then
  81.     MinPriceDuringTrade = 0;            
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment