rebasega10

Macd cross over strategy by Reba

FX:NAS100   유에스 100 캐쉬 CFD
```
//@version=4

strategy("NASDAQ 15-Minute Trading Strategy", overlay=true, margin_long=100, margin_short=100)

// Exponential Moving Average with a period of 1000
ema = ema(close, 1000)

// MACD Indicator
= macd(close)

// Buy and Sell Signals
buySignal = crossover(macdLine, signalLine) and close > ema and macdLine < 0
sellSignal = crossunder(macdLine, signalLine) and close < ema and macdLine > 0

// Stop Loss and Risk-to-Reward Ratio
stopLoss = ema * 0.98
takeProfit = ema * 1.022
risk = abs(close - stopLoss)
reward = abs(close - takeProfit)
riskToRewardRatio = risk / reward

// Execute Buy and Sell Trades
if (buySignal)
strategy.entry("Buy", strategy.long)
strategy.exit("Stop Loss", "Buy", stop=stopLoss)
strategy.exit("Take Profit", "Buy", limit=takeProfit)
strategy.order("Risk-to-Reward", strategy.short, qty=riskToRewardRatio)

if (sellSignal)
strategy.entry("Sell", strategy.short)
strategy.exit("Stop Loss", "Sell", stop=stopLoss)
strategy.exit("Take Profit", "Sell", limit=takeProfit)
strategy.order("Risk-to-Reward", strategy.long, qty=riskToRewardRatio)
```
면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.