FX:EURUSD   Euro / U.S. Dollar
// Take profit script for EURUSD pair over a 5 minute period

// Define variables
def ticker = ticker("EURUSD")
def duration = 5m
def currentPrice = close(ticker)
def targetPrice = currentPrice + (currentPrice * 0.01) // aim for a 1% profit

// Calculate probability of reaching target price
def probability = quantumProbability(ticker, duration, targetPrice)

// If probability is high enough, place trade
if (probability > 0.8) {
marketSell(ticker, duration)
}
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.