buy after 3 events

Forums ProRealTime English forum ProOrder support buy after 3 events

Viewing 4 posts - 1 through 4 (of 4 total)
  • #173235

    Hello,

    I’m trying to figure out how to program a code in which the buy order takes place after an event that happens 3 times in the last 10 days.

    The event is X in the following code:

    Thanks in advance,

    Assaf

     

    #173236

    There you go:

    check when COUNT  reaches 3 and no more than 10 days have elapsed.

    Actually I am not sure your code is fine. I fear that BREAK may affect Count in a wrong way.

    Try it, but if it doesn’t work, add a better explanation of what it does and what you need.

     

     

     

    2 users thanked author for this post.
    #173251

    Thank you. I think you are right about the BREAK thing, This is the corrected version of it:

    MyRSI = rsi[9](Close)
    RsiMin = MyRSI > MyRSI[1] and MyRSI[1] < MyRSI[2] and MyRSI[1] < 30
    ONCE Count = 0
    if RsiMin then
    RSIMin1 = MyRSI[1]
    Low1 = Low[1]
    for I = 3 to 80
    if RSIMin[I] then
    RSIMin2 = MyRSI[I + 1]
    Low2 = Low[I + 1]
    x= Low1 < Low2 and RSIMin1 > RSIMin2
    Count = Count + 1
    break
    endif
    next
    endif

     

    Can you please show me how to write a buying order that makes sure that all 3 events occur within 10 days?

    Thanks again,

    Assaf

    #173254

    There you go:

    1 user thanked author for this post.
Viewing 4 posts - 1 through 4 (of 4 total)

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