ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

How to Fix Backtest Not Showing Any Results for a SMA Crossover Script in TradingView

Автор: vlogize

Загружено: 2025-05-21

Просмотров: 10

Описание: Learn how to fix issues with your SMA crossover script in TradingView that prevent backtesting results from showing. Follow our step-by-step guide for troubleshooting and correcting your Pine Script code.
---
This video is based on the question https://stackoverflow.com/q/69891234/ asked by the user 'Sunil Doddapaneni' ( https://stackoverflow.com/u/7037953/ ) and on the answer https://stackoverflow.com/a/69900890/ provided by the user 'TJalam' ( https://stackoverflow.com/u/14828615/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions.

Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: Backtest not showing any results for a SMA crossover script in tradingview

Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/l...
The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license.

If anything seems off to you, please feel free to write me at vlogize [AT] gmail [DOT] com.
---
Troubleshooting: Backtest Not Showing Results in TradingView

If you're a trader using TradingView, you may encounter issues with your backtests not yielding any results, especially when it comes to implementing a Simple Moving Average (SMA) crossover strategy. This can be frustrating, particularly if you are confident in the code you’ve written. In this guide, we'll delve into a common pitfall associated with a SMA crossover script and provide a clear solution to fix the issue.

The Problem

You may have a Pine Script for a SMA crossover strategy like the one provided below. Despite having no errors during compilation, your backtest results return empty. Here’s a code snippet that represents the situation:

[[See Video to Reveal this Text or Code Snippet]]

The key issue arises with the strategy.close() line where an unknown trade ID "sell" is used incorrectly.

Analyzing the Solution

To resolve the problem and ensure that backtest results are properly displayed, follow these steps:

1. Understand the strategy.entry() and strategy.close() Functions

The strategy.entry() function requires a unique identifier for trade entries, allowing you to manage positions later. The strategy.close() function must reference an existing trade ID that was used in strategy.entry().

2. Correct the Trade ID

In the original script, the line:

[[See Video to Reveal this Text or Code Snippet]]

uses "sell" as the trade ID. However, this ID never matches any strategy.entry() call, producing no results in your backtest.

3. Update Your Code

Correct the trade ID in the strategy.close() function to ensure consistency with your strategy.entry():

[[See Video to Reveal this Text or Code Snippet]]

Complete Corrected Script

Here’s the full corrected code to ensure proper backtesting:

[[See Video to Reveal this Text or Code Snippet]]

Conclusion

By correcting the trade ID in your strategy.close() function to match the ID from your strategy.entry(), you can finally see your backtest results. Fixing this small but crucial detail can transform your Pine Script experience in TradingView from one of frustration to success.

If you are still having trouble or need further customization in your trading strategies, consider reaching out to the TradingView community forums or check out additional resources on Pine Script coding.

Happy trading!

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
How to Fix Backtest Not Showing Any Results for a SMA Crossover Script in TradingView

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

«Притча во языцех НАТО»: Лавров жёстко объяснил, что стало с Прибалтикой

«Притча во языцех НАТО»: Лавров жёстко объяснил, что стало с Прибалтикой

Я в опасности

Я в опасности

Орешник это модернизированный Рубеж? И как украинцы узнали об ударе 9 января заранее?

Орешник это модернизированный Рубеж? И как украинцы узнали об ударе 9 января заранее?

Создание печатных плат для начинающих — руководство от начала до конца за 10 минут

Создание печатных плат для начинающих — руководство от начала до конца за 10 минут

Декораторы Python — наглядное объяснение

Декораторы Python — наглядное объяснение

«Если Гренландия важна США — Крым важен России!»: Лавров жёстко прошёлся по Трампу и НАТО

«Если Гренландия важна США — Крым важен России!»: Лавров жёстко прошёлся по Трампу и НАТО

Лучшая Музыка 2026🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно 2026 #425

Лучшая Музыка 2026🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно 2026 #425

Обстрелы стирают Украину

Обстрелы стирают Украину

KONTRA #21 Rymanowski, Budzisz, gen. Komornicki: Świat według Donalda

KONTRA #21 Rymanowski, Budzisz, gen. Komornicki: Świat według Donalda

CEP - Kolejny sojusznik Rosji na celowniku USA.

CEP - Kolejny sojusznik Rosji na celowniku USA.

Запись Потоков Данных в Базу Данных в Реальном Времени | Fetch Data | Объекты в Программировании

Запись Потоков Данных в Базу Данных в Реальном Времени | Fetch Data | Объекты в Программировании

Твоя ПЕРВАЯ НЕЙРОСЕТЬ на Python с нуля! | За 10 минут :3

Твоя ПЕРВАЯ НЕЙРОСЕТЬ на Python с нуля! | За 10 минут :3

Opencode Заменил мне Claude Code – Вот Почему

Opencode Заменил мне Claude Code – Вот Почему

I Backtested Golden Cross and Death Cross Trading Strategy. Learn How to Backtest a Trading Strategy

I Backtested Golden Cross and Death Cross Trading Strategy. Learn How to Backtest a Trading Strategy

Я Обманул Экспертов Элитной Парфюмерии Спреем с Пердежом

Я Обманул Экспертов Элитной Парфюмерии Спреем с Пердежом

Тестирование любой стратегии торговли акциями в thinkorswim

Тестирование любой стратегии торговли акциями в thinkorswim

Психология Людей, Которые Прошли Через Слишком Многое | 6 Черт Сильных Личностей

Психология Людей, Которые Прошли Через Слишком Многое | 6 Черт Сильных Личностей

Инвесторы сбрасывают гособлигации США — доллар на грани обвала!

Инвесторы сбрасывают гособлигации США — доллар на грани обвала!

Самые ПРИБЫЛЬНЫЕ ниши для малого бизнеса ВО ВСЕ ВРЕМЕНА! / Как выбрать дело на ВСЮ жизнь?

Самые ПРИБЫЛЬНЫЕ ниши для малого бизнеса ВО ВСЕ ВРЕМЕНА! / Как выбрать дело на ВСЮ жизнь?

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]