// สร้างสัญญาณการเข้าซื้อและขาย longCondition = crossover(macdLine, signalLine) and close > sma(close, 50) and rsiValue < 30 shortCondition = crossunder(macdLine, signalLine) and close < sma(close, 50) and rsiValue > 70
// การจัดการตำแหน่ง strategy.entry("Buy", strategy.long, when = longCondition) strategy.entry("Sell", strategy.short, when = shortCondition) strategy.close("Buy", when = crossunder(macdLine, signalLine) and close < sma(close, 50)) strategy.close("Sell", when = crossover(macdLine, signalLine) and close > sma(close, 50))
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.