Command depending on prior command

Forums ProRealTime English forum ProBuilder support Command depending on prior command

Viewing 8 posts - 1 through 8 (of 8 total)
  • #51270

    Hello!

     

    I am coding a Higher High Higher Close + Lower Low Lower Close indicator which tells me when some conditions are met.

    I want to tell the indicator only to give a HHHC if the last one was LLLC and vice versa.

     

    This is the code so far:

    I have tried giving the different conditions variables as hh=1 and ll=1 and test if condtions are met  but what happens is all my drawings disapear so i guess ive done something wrong.

     

    Please help!

    /Viktor

    #51271

    This is without hh=1 and ll=1 conditions:

     

     

    #51310

    Each time you find a new lllc give ‘signal’ variable a -1 value and each time you find a new hhhc signal give ‘signal’ variable a 1 value. Test this variable accordingly before giving a new signal.

    1 user thanked author for this post.
    #51313

    Each time you find a new lllc give ‘signal’ variable a -1 value and each time you find a new hhhc signal give ‘signal’ variable a 1 value. Test this variable accordingly before giving a new signal.

    Thank you! So for lllc to be detected it should be “if signal[1]=1 then”? And vice versa?

    #51332

    doesnt work

    #51334

    OK so i added “once signal=1” and now it seems to work fine. Was that correct? I dont quite understand the logic behind this command 😀

    #51344

    “signal” is just a dummy variable to tell your program what was the last thing you plotted on your chart (an arrow up or an arrow down).

    #51345

    I understand that 🙂 But without me adding the “once” command nothing happened – that was my questions.

     

    Anyway – many many thanks! Really appreciate it!!

Viewing 8 posts - 1 through 8 (of 8 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login