// Entry and Exit Conditions using Simple Moving Averages longCondition = ta.crossover(fastMA, slowMA) shortCondition = ta.crossunder(fastMA, slowMA)
// Candlestick Patterns Functions isBullishEngulfing() => (open[1] > close[1] and close > open and close >= open[1] and close[1] >= open and close - open > open[1] - close[1]) isBearishEngulfing() => (close[1] > open[1] and open > close and open >= close[1] and open[1] >= close and open - close > close[1] - open[1]) isHammer() => (((high - low) > 3 * (open - close)) and ((close - low) / (.001 + high - low) > 0.6) and ((open - low) / (.001 + high - low) > 0.6)) isInvertedHammer() => (((high - low) > 3 * (open - close)) and ((high - close) / (.001 + high - low) > 0.6) and ((high - open) / (.001 + high - low) > 0.6)) isBullishHarami() => (open[1] > close[1] and close > open and close <= open[1] and close[1] <= open and close - open < open[1] - close[1]) isBearishHarami() => (close[1] > open[1] and open > close and open <= close[1] and open[1] <= close and open - close < close[1] - open[1])
// Calculate SMA for Visualization sma_22 = ta.sma(close, 22) lineColor = close > sma_22 ? color.black : color.black plot(show_sma ? sma_22 : na, color=lineColor, linewidth=1)
// Determine T and TT Labels based on Conditions candleCrossG = ta.crossover(close, sma_22) candleCrossR = ta.crossunder(close, sma_22)
// Place Trades Based on Conditions if (longCondition) strategy.entry("BUY ", strategy.long) strategy.exit("Take Profit", from_entry="Long", limit=close + takeProfitDistance, stop=close - stopLossDistance)
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.