TradingView
rthomson
1 กรกฎา 2018 เวลา 4 นาฬิกา 53 นาที

MA Crossover Strategy 

Bitcoin / United States DollarCoinbase

คำอธิบาย

Allows you to backtest different SMA & EMA crossover strategies.
ความคิดเห็น
bishlar
Hi!

Thanks for the good job. I still have an issue with my script, how do you do to have the signal one period after the cross and not right on the cross?

Thanks!
rthomson
@bishlar, it's a fault with Pinescript that on Strategies the entries are always a bar or two late.
bishlar
@rthomson, thanks for the answer.
But i mean: i implemented a very simple crossover strategy, kind of MACD.
When i backtest my strategy, the issue is that the signal is given on the entry of the candle which makes the cross. But to be exact, the signal should be given on the close of the candle which makes the cross, or on the open of the next candle. And i dont mange how to do so. (it seems to be that way on your chart).

I hope i am clear enough :)

rthomson
@bishlar, that should be automatic if its an actual Strategy and not a Study.
bishlar
@rthomson, oh right thanks!
I found my problem, i set an offset on the plot of my MAs but it isnt taken account for the crossover function. Is there a way to add an offset straight when using the sma function or in the crossover function?
Thanks for the help mate
rthomson
@bishlar, not as far as I know, but I have never tried
GarethSA
Hi
1) How far back does this script calculate as there are no settings for it?
2) This script produces a different % to other scripts that are the same?
rthomson
@GarethSA, 1) as many candles as that timeframe has, 2) No comment as I've no idea what other scripts might be doing. This is a very basic script, to give you an idea for something to code from, or screen out some more promising MA crossovers from others.
GarethSA
@rthomson, Thanks

Can i calculate strategys on Heiken-Ashi aswell or ONLY candle?
rthomson
@GarethSA, virtually any strategy performed on Heikin Ashi candles gives meaninglessly good results, due to an bug. There are very complex ways round it, which you can discover on @PineScripters telegram group, but not for the beginner.
เพิ่มเติม