// Entry Condition: When Short EMA crosses above Long EMA longCondition = ta.crossover(emaShort, emaLong)
// Exit Condition: When Short EMA crosses below Long EMA exitCondition = ta.crossunder(emaShort, emaLong)
// Strategy Logic if (longCondition) // Open a new long position if not already in one strategy.entry("Long", strategy.long)
// If we want to automatically exit the long position via Stop Loss and Take Profit: strategy.exit( "Exit Long", from_entry = "Long", stop_loss = strategy.position_avg_price * (1 - stopLossPerc/100), limit = strategy.position_avg_price * (1 + takeProfitPerc/100) )
// Also, if exit condition is triggered by EMA cross: if (exitCondition) strategy.close("Long")
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.