Bitcoin Forum
May 02, 2024, 08:11:41 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to back test indicator  (Read 112 times)
forestx (OP)
Jr. Member
*
Offline Offline

Activity: 168
Merit: 7


View Profile
December 07, 2021, 07:53:08 PM
 #1

I am currently stuck in a long trade with BTC and may not be out of it for a month or more. So looking at other strategies and indicators.
I have downloaded scripts on TV which indicate buy sell trades. I have done some basic manual back testing but want to automate it and check different stop/losses and see which is best

However I dont know how to do this. The script is just an indicator and cant be back tested
What I want to do is create a budget how much to spend per trade open position when signal and close based on a s/l
I have checked out videos on pine script but cant figure out an easy way to add this to my script. Is there one or all tools I can use or anyway to do this.

Thanks
Bitcoin addresses contain a checksum, so it is very unlikely that mistyping an address will cause you to lose money.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714680701
Hero Member
*
Offline Offline

Posts: 1714680701

View Profile Personal Message (Offline)

Ignore
1714680701
Reply with quote  #2

1714680701
Report to moderator
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
December 07, 2021, 08:27:05 PM
 #2

So you've got a script that can run the indicator and indicate what? Whether to buy or sell or does it just plot the indicator?

Why can't you just add the backtesting to the script and download data from somewhere for whatever timeframe you're hoping to trade?

You could then just set a few variables yourself and have it iterate for as long as you want/as much as the data provides.
Silberman
Legendary
*
Offline Offline

Activity: 2506
Merit: 1332


View Profile
December 07, 2021, 09:17:55 PM
 #3

I am currently stuck in a long trade with BTC and may not be out of it for a month or more. So looking at other strategies and indicators.
I have downloaded scripts on TV which indicate buy sell trades. I have done some basic manual back testing but want to automate it and check different stop/losses and see which is best

However I dont know how to do this. The script is just an indicator and cant be back tested
What I want to do is create a budget how much to spend per trade open position when signal and close based on a s/l
I have checked out videos on pine script but cant figure out an easy way to add this to my script. Is there one or all tools I can use or anyway to do this.

Thanks
You do not really backtest an indicator but a strategy built around it, you need to have a way to automate the whole process, for example how big your position will be? When you enter the market? When you exit the market? Are you using a stop loss and if you do how wide it is? How many markets will you trade? All of this needs to be considered before you type a single line of code, and once you do then your code can begin to take shape.
carlfebz2
Hero Member
*****
Offline Offline

Activity: 2926
Merit: 727


View Profile
December 07, 2021, 09:59:29 PM
 #4

You can make use of TradingView when it comes to back testing but if i were you then you should directly make out some live engagement on where at least you could really train up yourself.

You could read up other options too.
https://www.tradingwithrayner.com/how-to-backtest-a-trading-strategy/
palle11
Sr. Member
****
Offline Offline

Activity: 2310
Merit: 332


View Profile
December 07, 2021, 10:59:57 PM
 #5

Back testing may really be more confusing than it is going to help if it didn't work, that is if back testing do exist or I didn't really see the possibility of using the past to judge the present and future to get the exact market direction, all is just part of speculation that is what it is.

The way is going back to the past market waves and to use that to speculate on the market. All indicators can be examined like RSI and others.
Bitcoin_Arena
Copper Member
Legendary
*
Offline Offline

Activity: 2016
Merit: 1786


฿itcoin for all, All for ฿itcoin.


View Profile
December 07, 2021, 11:44:43 PM
 #6

You are probably just to do some tinkering around the downloaded script to be able to run a back test according to the strategy you want, but the problem is, I think you don't have enough knowledge about pine script language.

I suggest you first learn the basics of the scripting language. There are so many tutorials on TV about Pine script language. There is no shortcut if you are a first timer  Wink

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
BitMaxz
Legendary
*
Offline Offline

Activity: 3248
Merit: 2955


Block halving is coming.


View Profile WWW
December 07, 2021, 11:54:37 PM
 #7

I think what he looking for is a bot that could automate test any indicator and strategies.

There are lots of bots out there to automate them there are some paid and free trading bots. If you want a free one then there is one option that I know you can use to test those strategies and indicators automatically.

Check zenbot they have underdeveloped backtesting scripts that you can find here below

- https://github.com/DeviaVir/zenbot/tree/a20349d1c877287372f2b8d7ae0826222b8938f5/scripts

So the automate backtesting script is I think what you looking for.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
forestx (OP)
Jr. Member
*
Offline Offline

Activity: 168
Merit: 7


View Profile
December 08, 2021, 12:06:36 AM
 #8

Yea I dont think there is going to be an easy way to do this. I tried changing elements of the script but instantly got errors. I have experience of PHP but not much else tried messing around with Pine in the summer and built basic indicators and strategies but nothing real
Ararbermas
Sr. Member
****
Offline Offline

Activity: 1988
Merit: 283


View Profile
December 08, 2021, 05:49:20 AM
 #9

It's on the graph mate,wherein just go to the previous days which part you want to back test your indicators then apply it to see how it really works, if you're planning to day trade i suggest use small time frame such 1m,3m,5m to see if the indicators is really accurate. Because sometimes some indicators didn't show some information in other time frame so must do it.
michellee
Hero Member
*****
Offline Offline

Activity: 2772
Merit: 842


🐺Spinarium.com🐺 - iGaming casino


View Profile
December 08, 2021, 06:31:34 AM
 #10

I am currently stuck in a long trade with BTC and may not be out of it for a month or more. So looking at other strategies and indicators.
I have downloaded scripts on TV which indicate buy sell trades. I have done some basic manual back testing but want to automate it and check different stop/losses and see which is best

However I dont know how to do this. The script is just an indicator and cant be back tested
What I want to do is create a budget how much to spend per trade open position when signal and close based on a s/l
I have checked out videos on pine script but cant figure out an easy way to add this to my script. Is there one or all tools I can use or anyway to do this.

Thanks
I wish there were ways to automate the trading process so we do not have to watch too often for the bot to run. But we know that the market will always change from time to time and even if you have the best strategies and use the best indicators, you still need to watch the market because when the market changes the direction and you are not online, your robot will not work at all. But maybe you can try to use Gunbot, CAT, or another bot but you still need to check the setting many times to make sure the bot still running.

I do not know how to test the strategy but you can test it by using it directly to trade because by doing that, we will know what needs to modify and it will help us get a good setting for the strategy.

.
SPIN

       ▄▄▄██████████▄▄▄
     ▄███████████████████▄
   ▄██████████▀▀███████████▄
   ██████████    ███████████
 ▄██████████      ▀█████████▄
▄██████████        ▀█████████▄
█████████▀▀   ▄▄    ▀▀▀███████
█████████▄▄  ████▄▄███████████
███████▀  ▀▀███▀      ▀███████
▀█████▀          ▄█▄   ▀█████▀
 ▀███▀   ▄▄▄  ▄█████▄   ▀███▀
   ██████████████████▄▄▄███
   ▀██████████████████████▀
     ▀▀████████████████▀▀
        ▀▀▀█████████▀▀▀
.
RIUM
.
███
███
███
███
███
███
███
███
███
███
███
███
SAFE GAMES
WITH WITHDRAWALS
       ▄▀▀▀▀▀▀▄▄▄▄
 ▄▀▀▀▀▀▀▀▀▀▀▀▀▄  ▀▀▄
█    ▄         █   ▀▌
█   █ █        █    ▌
█      ▄█▄     █   ▐
█     ▄███▄    █   ▌
█    ███████   █  ▐
█    ▀▀ █ ▀▀   █  ▌
█     ▄███▄    █ ▐
█              █▐▌
█        █ █   █▌
 ▀▄▄▄▄▄▄▄▄█▄▄▄▀
       ▄▀▀▀▀▀▀▄▄▄▄
 ▄▀▀▀▀▀▀▀▀▀▀▀▀▄  ▀▀▄
█    ▄         █   ▀▌
█   █ █        █    ▌
█      ▄█▄     █   ▐
█     ▄███▄    █   ▌
█    ███████   █  ▐
█    ▀▀ █ ▀▀   █  ▌
█     ▄███▄    █ ▐
█              █▐▌
█        █ █   █▌
 ▀▄▄▄▄▄▄▄▄█▄▄▄▀
.
███
███
███
███
███
███
███
███
███
███
███
███
.
.SIGN UP.
Fesatmas
Sr. Member
****
Offline Offline

Activity: 2268
Merit: 275



View Profile
December 08, 2021, 07:55:10 AM
 #11

Yea I dont think there is going to be an easy way to do this. I tried changing elements of the script but instantly got errors. I have experience of PHP but not much else tried messing around with Pine in the summer and built basic indicators and strategies but nothing real

Why do it if you end up making a fatal mistake? What you should be looking for is a trading bot, right? Therefore do not immediately apply scripts that are not supported by strong beliefs. The tutorials on TV don't really give any further instructions on what is needed before running the script. You have to master a lot of procedures before implementing it all. Can you undo the script operation? and it's better to go back to the initial trading manually.

.
DuelbitsSPORTS
▄▄▄███████▄▄▄
▄▄█████████████████▄▄
▄██████████████████████▄
██████████████████████████
███████████████████████████
██████████████████████████████
██████████████████████████████
█████████████████████████████
███████████████████████████
█████████████████████████
▀████████████████████████
▀▀███████████████████
██████████████████████████████
██
██
██
██

██
██
██
██

██
██
██
████████▄▄▄▄██▄▄▄██
███▄█▀▄▄▀███▄█████
█████████████▀▀▀██
██▀ ▀██████████████████
███▄███████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
▀█████████████████████▀
▀▀███████████████▀▀
▀▀▀▀█▀▀▀▀
OFFICIAL EUROPEAN
BETTING PARTNER OF
ASTON VILLA FC
██
██
██
██

██
██
██
██

██
██
██
10% CASHBACK
          100% MULTICHARGER
hugeblack
Legendary
*
Offline Offline

Activity: 2506
Merit: 3631


Buy/Sell crypto at BestChange


View Profile WWW
December 08, 2021, 01:43:35 PM
 #12

You can use tradingview with many bots that work according to the conditions in the script, which are the platform, the available commands, and then compare them with any bot and reprogram it to match it.

In general, I do not see that indicators are a reliable thing in automated trading, and therefore you should be careful in giving the powers of buying and selling.
The role of the script in Bitcoin may be good, but there may be some side doors that allow selling Bitcoin to buy unknown currencies (part of a systematic pumping)

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
awik p
Full Member
***
Offline Offline

Activity: 1526
Merit: 111


Pepemo.vip


View Profile
December 08, 2021, 02:15:52 PM
 #13

I am currently stuck in a long trade with BTC and may not be out of it for a month or more. So looking at other strategies and indicators.
I have downloaded scripts on TV which indicate buy sell trades. I have done some basic manual back testing but want to automate it and check different stop/losses and see which is best

However I dont know how to do this. The script is just an indicator and cant be back tested
What I want to do is create a budget how much to spend per trade open position when signal and close based on a s/l
I have checked out videos on pine script but cant figure out an easy way to add this to my script. Is there one or all tools I can use or anyway to do this.

Thanks
I think the script is a tool to determine our position, and of course you want to be able to quickly set targets and stop losses on each trade. and you use indicators to analyze market movements. what you need to know is that every signal given by the indicator is not all valid, so it really does require a stop loss and a target, and with a script we can open many transactions in one click

Bitcoin_Arena
Copper Member
Legendary
*
Offline Offline

Activity: 2016
Merit: 1786


฿itcoin for all, All for ฿itcoin.


View Profile
December 08, 2021, 10:37:44 PM
 #14

Yea I dont think there is going to be an easy way to do this. I tried changing elements of the script but instantly got errors. I have experience of PHP but not much else tried messing around with Pine in the summer and built basic indicators and strategies but nothing real
Yeah, It isn't easy but if you are really committed, you can learn and be able to know what's wrong or the right way to do  it.

I don't know why people are suggesting you to use bots to "automate" everything, forgetting that you still need to have some scripting knowledge, especially if you are trying to come up with your own strategies and backtest them.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
forestx (OP)
Jr. Member
*
Offline Offline

Activity: 168
Merit: 7


View Profile
December 08, 2021, 11:21:50 PM
 #15

I got the code working kind of did it to day at work. It appears to be working but there are two issues
One is just the profit isnt as high as I would think and not when doing manual backtesting. Depending on settings I am getting an 80% win rate but only 1% profit
The other issue it only appears to go back a couple of months I cant seem to get the time frame to change I have the code but its not working

anyhow I will mess around with it more and also learn more about the code. What I am trying to do is test different stategies I find on Youtube and see which is best and then paper trade it and compare the results

Zilon
Sr. Member
****
Offline Offline

Activity: 966
Merit: 421

Bitcoindata.science


View Profile WWW
December 09, 2021, 10:36:16 AM
 #16

I have downloaded scripts on TV which indicate buy sell trades. I have done some basic manual back testing but want to automate it and check different stop/losses and see which is best

However I dont know how to do this. The script is just an indicator and cant be back tested
What I want to do is create a budget how much to spend per trade open position when signal and close based on a s/l
I have checked out videos on pine script but cant figure out an easy way to add this to my script. Is there one or all tools I can use or anyway to do this.

Thanks
You don't trade indicators in isolation and indicators could either be leading or lagging so it's not even adviced to back yeat using indicators. Indicators are used majorly to confirm a strategy and not is not accurate enough to serve as  a strategy as it's prone to change direction or lag in giving trading signal

Develop a strategy then try back testing with your indicator because indicators aren't meant for all market condition and can also mislead
Silberman
Legendary
*
Offline Offline

Activity: 2506
Merit: 1332


View Profile
December 11, 2021, 06:29:31 PM
 #17

I got the code working kind of did it to day at work. It appears to be working but there are two issues
One is just the profit isnt as high as I would think and not when doing manual backtesting. Depending on settings I am getting an 80% win rate but only 1% profit
The other issue it only appears to go back a couple of months I cant seem to get the time frame to change I have the code but its not working

anyhow I will mess around with it more and also learn more about the code. What I am trying to do is test different stategies I find on Youtube and see which is best and then paper trade it and compare the results


That is bad, the winning rate is what I would consider high, basically winning 4 out of 5 trades is a very good performance when it comes to accurac,y but the fact that even in your backtest you are only earning 1% is worrying, after all real market conditions reduce your profits significantly so under those conditions I will say that so far the strategy that you are using losses money, which is not really that surprising since some strategies may look great on paper but once you use them you realize how useless they are.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!