Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ============================================================
- // INDICATORE SET EXIT ON CLOSE IF NOT MIN PROFIT //
- // ============================================================
- // ============================
- // USCITA LONG A FINE SESSIONE SE MOVIMENTO MINIMO NON RAGGIUNTO
- // ============================
- // ============================
- // LONG: aggiorna massimo intratrade candela per candela
- // ============================
- Inputs: MinTriggerLong(600);
- Vars: MaxPriceDuringTrade(0);
- // Aggiorna massimo intratrade
- If MarketPosition = 1 Then Begin
- If MaxPriceDuringTrade = 0 Then
- MaxPriceDuringTrade = EntryPrice; // inizializza al prezzo di entrata
- If High > MaxPriceDuringTrade Then
- MaxPriceDuringTrade = High;
- End;
- // ============================
- // FINE SESSIONE: esci se movimento minimo non raggiunto
- // ============================
- // Qui puoi chiamare questo blocco dal tuo SetExitOnClose già attivo a fine sessione
- // oppure in un evento di fine sessione
- If MarketPosition = 1 Then Begin
- // massimo profitto intratrade = massimo prezzo intratrade - EntryPrice
- If (MaxPriceDuringTrade - EntryPrice) * BigPointValue < MinTriggerLong Then
- SetExitOnClose;
- End;
- // ============================
- // RESET variabile alla chiusura trade
- // ============================
- If MarketPosition = 0 Then
- MaxPriceDuringTrade = 0;
- // ============================
- // USCITA SHORT A FINE SESSIONE SE MOVIMENTO MINIMO NON RAGGIUNTO
- // ============================
- // ============================
- // USCITA SHORT A FINE SESSIONE SE MOVIMENTO MINIMO NON RAGGIUNTO
- // ============================
- // ============================
- // SHORT: aggiorna minimo intratrade candela per candela
- // ============================
- Inputs: MinTriggerShort(600);
- Vars: MinPriceDuringTrade(0);
- // Aggiorna minimo intratrade
- If MarketPosition = -1 Then Begin
- If MinPriceDuringTrade = 0 Then
- MinPriceDuringTrade = EntryPrice; // inizializza al prezzo di entrata
- If Low < MinPriceDuringTrade Then
- MinPriceDuringTrade = Low;
- End;
- // ============================
- // FINE SESSIONE: esci se movimento minimo non raggiunto
- // ============================
- // Qui puoi chiamare questo blocco dal tuo SetExitOnClose già attivo a fine sessione
- // oppure in un evento di fine sessione
- If MarketPosition = -1 Then Begin
- // massimo profitto intratrade = EntryPrice - minimo intratrade
- If (EntryPrice - MinPriceDuringTrade) * BigPointValue < MinTriggerShort Then
- SetExitOnClose;
- End;
- // ============================
- // RESET variabile alla chiusura trade
- // ============================
- If MarketPosition = 0 Then
- MinPriceDuringTrade = 0;
Advertisement