//@version=5 strategy("Convert MQL5", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100) TakeProfit=input.int(50, title="Take Profit") value1=input(7, title="Quantity of day low") value2=input(7, title="Quantity of day high") entry=ta.lowest(low[1],value1) exit=ta.highest(high[1],value2) plot(entry, linewidth =2) plot(exit, linewidth =2) isBuyValid = strategy.position_size == 0 and closeexit if (isBuyValid) strategy.entry("Long", strategy.long , comment="buy") strategy.close("Long", when =close>exit , qty_percent = 100, comment = "close") strategy.exit("exit", "Long", profit = TakeProfit, comment = "closeTP") if (isSellValid) strategy.entry("Short", strategy.short , comment="sell") strategy.close("Short", when =close< entry , qty_percent = 100, comment = "close") strategy.exit("exit", "Short", profit = TakeProfit, comment = "closeTP")