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".

X number of Pips in Y number of candles script

Feb 10, 2021 - 9:39 AM

Viewed 755 times

https://best-trading-indicator.com/community/bti/forums/4180/topics/22779 COPY
  • Hello,

    I see how people are posting here, they have a code with errors and asking solutions but i really have no idea how to code and no idea how to start...
    I'm asking for some guindance in my idea which i think it might be pretty simple.

    if( curent close price - previous candle open) > curent ATR
    then alarm

    this is a bulish case, in a bearish case , it's the opposite

    So basically. if the price moves more than 1 ATR in 2 candle then sends an alarm.

    Now...i myself dont have knowledge to code that. But does anyone know a script like this ?

    Thank you very much !

    0
  • Hi there

    I'd recommend you to start reading this page and all the mentioned articles before coding your first TradingView script

    URL: https://www.pinecoders.com/learning_pine_roadmap/

    //@version=4
    
    my_atr = at(14)
    
    if (close - open[1] > my_atr )
      alert("bull case",  alert.freq_once_per_bar_close)
    else
     alert("bear case",  alert.freq_once_per_bar_close)
    
    0
  • Dave (@dave):
    Hi there
    I'd recommend you to start reading this page and all the mentioned articles before coding your first TradingView script
    URL: https://www.pinecoders.com/learning_pine_roadmap/

    Hello Mr,
    Thank you for your quick reply ;) i will take a look on that guide maybe someday i will figure these things by myself ;D

    I think there is an error on this line
    if (close - open[1] > my_atr)
    Mismatched input 'alert' expecting 'end of line without line continuation'.

    1
CONTENTS