I'm backtesting my strategy and I wanted to see which parameters are best for my strategy. Basically, if I have MACD(12, 26, 9), I wanna know if 12, 26, 9
are the best. The thing is how do I distinguish the strategy's performance between those parameters? I saw that there were properties like strategy.netprofit
. Did someone create a such script for testing parameters?

- 4,711
- 6
- 32
- 93
-
[Read the link](https://stackoverflow.com/questions/48998867/how-to-optimise-parameters-in-a-tradingview-pine-script) – AnyDozer Apr 19 '21 at 09:16
3 Answers
The beauty of TradingView is that ... you do not need to code anything in PineScript for this :D
- Choose your trading symbol and timeframe.
- Add the strategy called "MACD Strategy" (keyboard shortcut: "/").
- Go to the Strategy Tester tab. There you can see the Performance Summary of this indicator.
- Press on the wheel sign next to "MACD Strategy" to adjust the 3 parameters of your MACD and note the changes on performance.

- 81
- 1
-
I want to test multiple parameters automatically and to print the results with each parameter or sometihng like that. I don't see the wheel sign btw. Could you screenshot it – nop Apr 22 '21 at 12:28
There's no simple way to do it with TradingView, which is a serious drawback of the platform, rendering it pretty much useless for algotrading. Checked out TUNED instead.

- 71
- 1
- 5
-
1As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-ask). – Community Sep 15 '21 at 22:22
I was looking for the same ability and could not find it anywhere either. It looks like if you want to backtest where you provide a range of values per input paramter you would like to test, then you need to find a different platform to use. Tradingview is affordable to use, and I suppose if you are ok manually trying different values etc. it will do. If you want to have the machine seek out optimal settings for your strategy you would need something else. Obviously the high-end expensive products like Trade Station https://www.tradestation.com/platforms-and-tools/desktop/ do have all that functionality.

- 11
- 3
-
1Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 30 '21 at 12:49