Ask a master: How to write a script to calculate the number of cycles from the last condition to the current one? Thank you!
Welcome to the BEST forum for traders
Did you know we're sharing tons of exclusive content here?
Our community is growing quickly. Take a look around and say "Hello".
Ask a master: How to write a script to calculate the number of cycles from the last condition to the current one? Thank you!
Hi
You might want to use the barssince function for that
https://www.tradingview.com/pine-script-reference/v4/#fun_barssince
Dave
Hi gurus,
I'd appreciate it if someone can help me to solve this minor issue as I don't have coind background (newbies).
I have this code line:
size3 = accbalance * traderisk / sldist3/100
how do I add a code so that the result of that calculation can be both floats or integer ?
Cheers!
Hi there
It cannot be both integer and float
Size3 can either be integer or float - only 1 variable type per variable
Hope that helps
Dave