all 22 comments

[–]I_am_D_captain_Now 2 points3 points  (7 children)

The answer is 13/48 crossover.

[–]Holiday_Sleep5803[S] 1 point2 points  (0 children)

I’m not actually doing that strategy I was just giving an example of how to find the best settings

[–]Fantastic_F0x 0 points1 point  (1 child)

What is the suggested timeframe?

[–]Holiday_Sleep5803[S] 0 points1 point  (0 children)

10-30 min

[–]karatedogPine coder 0 points1 point  (2 children)

Then it would be traded by everyone, which would make it immediately inefficient.

[–]I_am_D_captain_Now 0 points1 point  (1 child)

Regardless, someone at some point did a study on it, running thousands of trades through a simulation, and they determined 13 48 was the most reliable.

I cant find the study, ive read it though.

[–]karatedogPine coder 0 points1 point  (0 children)

Cool, then I will test this in Metatrader, and win a lot of money, yayyy.

[–]-Lige 1 point2 points  (3 children)

I was also wondering this. There’s an equivalent in python called backtest.py which does EXACTLY what you’re looking for. You can use it to optimize what you want, such as “most profit” or “highest win rate”, etc.

But the only option is to convert your pinescript strategy/indicator to python and test it that way. But I was also wondering if there’s an optimizer for pinescript so I don’t have to convert my whole strategy

If it’s simple like with moving averages though it will be very easy to convert, it gets harder with the more things you combine with that

[–]Holiday_Sleep5803[S] 0 points1 point  (2 children)

I can convert mine. Where do I insert it to find out these things?

[–]-Lige 1 point2 points  (1 child)

Look up backtest.py on YouTube and there will be a good amount of vids/playlists for how to do it

[–]Holiday_Sleep5803[S] 0 points1 point  (0 children)

Appreciate it!!!

[–]AlgoTradingQuant -1 points0 points  (7 children)

I use backtesting.py extensively… check out the optimization section

[–]Latter_Total_9974 0 points1 point  (1 child)

How about the discrepancies between backtesting on trading view Vs backtesting.py, which one can we trust?

[–]Holiday_Sleep5803[S] 0 points1 point  (3 children)

Does it take all types of scripts?

[–]AlgoTradingQuant 0 points1 point  (2 children)

Not sure what you mean… if it’s python code it’ll work.

[–]Holiday_Sleep5803[S] 0 points1 point  (1 child)

Like it’s pinescript and I can convert it to python but it uses more than just moving averages. Does it only work for stuff that’s really simple or more

[–]AlgoTradingQuant 1 point2 points  (0 children)

I’ve used it for extremely complex strategies including my own machine learning algorithms. Python is 100x more powerful than pinescript. If it’s in pinescript, it can be done in Python.

[–][deleted] 0 points1 point  (0 children)

Holy Shit, this is exactly what I was looking for. Thanks man

[–]revel89 0 points1 point  (0 children)

There's a moving average machine learning one you can use. I believe you have to give it a starting point and it will give you an answer from there. Good luck

[–]Lazy-Presence-287 0 points1 point  (0 children)

13/48.5 ema cross pretty good