C320up

C320up Strategy Tester Start Time

C320up Strategy Tester Start Time

This is a little snippet you can paste into your Strategy to set the testing start date and time.

It is not a Strategy per se, though is an example with the timestamp script included.

Instructions are fairly straight forward, and are listed in the script.

If for some reason you also wanted an end date, that too is possible. Just leave a note in the comments.

Disclaimer: We searched for a similar script on TV, and could not find anything at this point in time.

You can set your preferred date and time in the input section of the settings.

Enjoy!
Informacje o Wersji: Update: We have added End Time to the script.

Why us Start Time and End Time?

Let’s say you want to test your strategy only during previous know bullish market conditions.

Perhaps your strategy may perform differently during bullish conditions compared to bearish conditions.

Take Bitcoin for example:

You could set your start time to 2017, 11, 12, 00, 00 and set your end time to 2017, 12, 17, 00, 00.

This would filter and only sample the last bull run from 2017-11-12 to 2017-12-17.
Usuń z Ulubionych Skryptów Dodaj do Ulubionych Skryptów
Thanks mate!

Just learning pine script and strategy testing through trial and error and this "snippet" is perfect. Your instructions are clear and it worked first time- just what I wanted to compare results in different market conditions.

Awesome- thanks again.
Odpowiedź
Hi, if I would like to end the strategy 1 day after the entry, how would I be able to do that? Thank you.
Odpowiedź
hsuperman hsuperman
I am relatively new to pine script, would appreciate any kind of help, and thank you for notifying me on the pine script chat @C320up
Odpowiedź
C320up hsuperman
@hsuperman, Just sent you a message.
Odpowiedź
C320up hsuperman
@hsuperman, You could try offset() function.

Copy and paste this into a new strategy to test.

//@version=3
strategy("Exit 1 Hour", overlay = true)
// Using 1 Hour Chart: 1 Bar = 1 Hour - 24 Bars = 24 Hours
long = crossover(sma(close, 14), sma(close, 28))
short = offset(long, 24) // 24 Bars Forward
if (long)
strategy.entry("Long", strategy.long)
if (short)
strategy.entry("Short", strategy.short)
Odpowiedź
Strona główna Skaner akcji Skaner Forex Skaner Krypto Kalendarz ekonomiczny Jak to działa Funkcje wykresów Cena Dobre Praktyki Moderatorzy Rozwiązania internetowe i brokerskie Widżety Wykresy Centrum Pomocy Zgłoś dodatkową funkcjonalność Blog i wiadomości Często zadawane pytania Wiki Twitter
Profil Ustawienia profilu Konto i płatności Monety TradingView Wiadomości do działu obsługi Centrum Pomocy Opublikowane Pomysły Obserwujący Lista obserwowanych Wiadomość prywatna Czat Wyloguj