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

Feb 6, 2021 - 3:50 PM

Viewed 393 times

https://best-trading-indicator.com/community/bti/forums/4180/topics/22738 COPY
  • Ask a master: How to write a script to calculate the number of cycles from the last condition to the current one? Thank you!

    0
  • Hi

    You might want to use the barssince function for that
    https://www.tradingview.com/pine-script-reference/v4/#fun_barssince

    Dave

    0
  • 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!

    0
  • 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

    0
CONTENTS