Looking to create a fairly simple automated trading strategy/script that can be used for backtesting and then live trading in the forex market on TradingView using Pine (version 4).
The premise is there are static price points that once the script is started, when the current buy price crosses above one of these points, a market buy is placed. A stop will be placed at the price point directly below. If the order crosses the next price point above, the stop will be moved up a price point. The order will continue until it is stopped. If an order gets stopped, a sell order will be placed and the same logic will work in reverse.
Exactly opposite to the above, once the script is started, should the current sell price cross below a price point, a market sell is placed.
Order amount should be calculated as a risk factor as % of current account balance or initial account balance if the account balance falls below the initial account balance.
I would also like visuals like colored horizontal lines drawn at price point intervals.
• Low starting price point
• Price point interval
• Number of price points to highlight
• Risk factor as percentage
• Initial account balance