Instruction
The script is written in JS, but its automation is written through Python. First, you need to install Python itself and the libraries that are used in the script, if you don't have
After that, you need to go to TradnigView and select the pair you need.
You can search for settings on any pair
After you have opened the chart you want, press CTRL + SHIFT + i. Also open the ruger indicator settings and the strategy tester. Everything should look like this
Now, you need to find the coordinates that the script will click on to change the period values. Click the PrintScreen button, open the Paint application and paste the resulting screenshot with ctrl + v.
In the Paint program, aim at the middle of the line for entering the data of the first period and remember the two values that will be indicated in your lower left corner. The first value is X, the second is Y for the first period. Then just move your mouse cursor down a little and write down the second Y value for the period 2 data entry line
You should end up with something like
1000 (this is x coords)
324 (this is y coords for period 1)
370 (this is y coords for period 2)
Drag the auto.py file to your desktop. Run cmd and enter:
cd desktop
pyhton auto.py
Enter the received coordinates
Be careful, the script for automation is activated on the R key, do not accidentally press it.
Go to your browser and enter the JS code I sent you into the console.
If all is well, you will receive this inscription:
Now, click on the line to enter data for period 1 (You can start searching for settings from 100 period, but I recommend you from 500, since searching with lower values does not make sense) Change Period 2 to 30, and enter 500 in the first period and leave the input line lit blue
Now, press the R key on your keyboard and the automatic search will start
The script searches in the second period for values from 30 to 500. In the first period, you can search for values from 100 to 10000
After looking for the values, close cmd and in the browser press:
Numpad 1 - Best Two Periods, With Highest Profit and Lowest Drawdown
Numpad 2 - Two periods that gave the smallest drawdown
Numpad 3 - Two Periods That Gave Better Profit Factor (P&L Ratio)
After finding the best settings, subtract 10 from the second period (for example, 300-10 = 290). You don't need to do anything with the first period.
js script: