Advertisement
Maurizio-Ciullo

Indicatore Uscite Multiple TK-SL Distanziati Dal Prezzo D'ingresso

Jun 22nd, 2023
892
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3.  
  4.                                     // Indicatore Uscite Multiple TK-SL Distanziati Dal Prezzo D'ingresso //
  5.                             // Esempio Ingresso 2 Contratti E Uscita Con 2 Tk O 2 SL Con 1 Contratto Fino Alla Chiusura Della Posizione //                                             
  6.  
  7. vars: open_long(false);
  8.  
  9. open_long = (close > open) and (close[1] > open [1]);
  10.  
  11. // Open Long
  12. if marketposition = 0 then                                                
  13. Begin;  
  14.     if open_long then                                                  
  15.     Buy("Entry") 2 Contract next bar at market;
  16. End;    
  17.  
  18.  
  19. // Close Long
  20. if marketposition = 1 then
  21. Begin;
  22.     Sell ("1mo TK") from entry ("Entry") 1 Contract Next Bar at Entryprice + 0.00090 limit;
  23.     Sell ("2do TK") from entry ("Entry") 1 Contract Next Bar at Entryprice + 0.00120 limit;
  24.     Sell ("1mo SL") from entry ("Entry") 1 Contract Next Bar at Entryprice - 0.00090 stop;
  25.     Sell ("2do SL") from entry ("Entry") 1 Contract Next Bar at Entryprice - 0.00120 stop;
  26. End;  
  27.  
  28.  
  29. // Close Long
  30. {if marketposition = 1 then
  31. Begin;
  32.     Sell ("1mo TK") from entry ("Entry") 1 Contract Next Bar at Entryprice + 0.00090 limit;
  33.     Sell ("2do TK") from entry ("Entry") 1 Contract Next Bar at Entryprice + 0.00820 limit;
  34.     Sell ("1mo SL") from entry ("Entry") 1 Contract Next Bar at Entryprice - 0.00090 stop;
  35.     Sell ("2do SL") from entry ("Entry") 1 Contract Next Bar at Entryprice - 0.00120 stop;
  36. End;}
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement