Canundo

Cross impro test by Canundo Crossover Crossunder Tick values

This is a script where I tried to check the following things:

  • Even thought the tick of an asset is, for example 0.5, there are calculated prices, like SMA's that have even more decimals. Leading to crosses happening that for example happen at the same price. Consequently triggering totally useless in side markets. What happens if SMA values are restricted to the tick resolution? (Option works on it's own or with a combination of the others.)
  • What happens if I set my own tick value, like 0.8 instead of 0.5, what will be the effect for calculated values that are used for crossings? Will tick sizes improve the success rate? (This option will work only when the first option is active.)
  • Can success rate, especially for sideway markets be improved when adding a spread between MA's, so that it triggers less in sideway markets? (Option works on it's own or with a combination of the others.)

First of all, I had a hard time to round prices properly when it needs to be dynamic and working for different assets with different amounts of decimal values in the tick. The solution is that abs(floor(syminfo.mintick)) will give you the amount of decimals a tick has. It works for all ticks that are at least lower than 10. I'm not sure how huge ticks are out there. I did not implement this solution at the end since I found another way to test it.

Findings:

The first option, when activated, takes out half the trades and raises the percent profitability by 8% so there is some effect. However, all of the tested options have less advantage than I hoped for but are nevertheless something worthy for sideway markets. The first option just forces the MA's from the example to use the tick resolution.

See these two images. One when the first option is off, the second when it's active.



The lines are the MA's with adjusted values, the crosses are the places of the MA's when left as is.

Here a screenshot of the third option set to the value 2 on the 1 minute XBTUSD chart.


The advantage is that less trades trigger that have a low change in price and so less trading fees will happen.
The disadvantage is that all options can implement some delay for a crossing since the crossing will trigger once a slightly bigger move into the direction was taken.

This test environment was not meant to be profitable but to test the effects.

Maybe someone finds it interesting or wanted to test the same, so here you can save some work.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?