Basic trading strategy for stocks coding help

Forums ProRealTime English forum ProOrder support Basic trading strategy for stocks coding help

Viewing 2 posts - 1 through 2 (of 2 total)
  • #59759

    Hi, I would like the backtest a trading strategy but I’m not sure how to do it.

    The strategy is the following;

    Bull:

    • Stock has to be above previous day close at least +2% (already have code for this)
    • stock then has to fall at least 1%, this is counted from candle high to low instead of close
    • position is opened once stock regains half of it’s previous fall.
    • This whole process has to happen in under 2 hours, typically it happens in under 30 minutes so 5 minute timeframe will be used, but since PRT only opens a position on the close of candle, maybe 1 minute timeframe would work better.

    Bear:

    • Stock has to be below previous day close at least -2%(already have code for this)
    • stock then has to rise at least 1%, this is counted from candle low to high instead close.
    • position is opened when stock falls to half of the previous rise
    • This process also has the same 2 hour time limit.

     

    Written Example;

    Bull:

    • Stock is up +2% on close, price is 100 at 9:00 am
    • Stock price then falls very fast too 98.5 at 9:15am (over 1% fall)
    • Stock price then rises too 99.25 at 9:30am.
    • As soon as price reaches 99.25, position is opened.
    • Process started at 9:00 a,m and finished at 9:30am which is under the 2 hour time limit.

     

    Attached are some labelled pictures of charts where this happens.

    Hope I made this clear enough, thanks in advance.

    #59814

    my advise:

    start with the trading assistant and implement the really basic condition. when it works add the next condition to it – maybe again using the assistant. and so on. that should bring you step-by-step to the final version.

    if you have questions, then write here, many active users here who help.

    good luck!

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

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