A function that buy when price goes down x % and the up x %

Forums ProRealTime English forum ProOrder support A function that buy when price goes down x % and the up x %

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

    Hi,

    I wish to code a function that buy when price goes down x % from the top (highest that day), and then up x % from the bottom (lowest that day) during the same day. But I can’t 🙂
    So if price goes down 0,5% it should not buy direct, but wait for a 0,1% rise from the bottom that day.
    The wait for a rise is just a try to protect from further downs –  say price falls 0,5% but then continue to 0,9%.
    Can I use DHigh(0)?
    If close < DHigh(0) – x then… ?
    if close > DLow(0) + x then
    buy at market
    endif
    Endif
    I will also probably use a time filter and maybe another price filter to determinate trend, but thats another story 🙂
    Thanks!
    All the best!
    Simon

    #12464

    Hi Simon, you should have a look at this screener: http://www.prorealcode.com/prorealtime-market-screeners/fibonacci-61-8-retracement/

    Its code should help you how to determine retracement percentage from recent highest high and lowest low.

     

    #12502

    Thanks Nicolas! I tried this:

     

    I wish to run it on 5-min. TF. Probably on DAX.
    Dose it make sense?

    Is DHigh(0) and DLow(0) calculated from 00:00 on a new day? Can I make it so it is calculated from 09.00 when market opens?

    All the best!
    Simon

    #12504

    The daily OHLC are always calculated from the very first intraday bar.
    Of course you can calculate yourself a customized OHLC from a different start hour.

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