'Could this strategy be updated to v4

I have been trying to update this v2 strategy to v4 without any luck; I am wondering if this could be done without actually re-coding it from scratch.

I am still a beginner with pinescript, and I have tried everything for the last few hours without being able to get it to successfully load.

I would highly appreciate any help/input.

Thank you



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source