Basic trading strategy for stocks coding help

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #59759 quote
    jbyrnejbyrne
    Participant
    Average

    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.

    temp-stock-1.png temp-stock-1.png
    #59814 quote
    mr bluemr blue
    Participant
    Senior

    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)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Basic trading strategy for stocks coding help


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
jbyrne @jbyrne Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by mr bluemr blue
8 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/18/2018
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...