New to pro trader and need help writing a simple algo

Forums ProRealTime English forum ProOrder support New to pro trader and need help writing a simple algo

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

    I am fairly new to pro trader real time. I need help writing the following algos:

     

    Algo 1: Go long

    1. For all stock instruments, check if today’s opening price is greater than yesterday’s closing price by at least 1%, if so proceed to step 2
    2. Check if current price is greater than today’s opening price by at least 3%, if so execute a long position

    Algo 2: Go short

    1. For all stock instruments, check if today’s opening price is less than yesterday’s closing price by at least 1%, if so proceed to step 2
    2. Check if current price is less than today’s opening price by at least 3%, if so execute a short position

    Once I have this algo defined, how do I run a backtest?

     

    Thanks for your help

     

    #131427

    There you go (not tested):

    this code will do a Stop & Reverse, if needed.

    If you don’t want this then replace LONGONMARKET and SHORTONMARKET with ONMARKET.

    #131428

    I’m a new bod also, but you can learn a lot from the free videos, https://www.prorealcode.com/courses/training-program-introduction-programming-prorealtime/ and there’s a 2nd course payable but likely worth a look… this will get you into the basics.

    #131429

    To backtest it, just set the backtest period after setting enough units for your TF, capital, spread and commissions if any, then click on the start backtest button.

    You may also want to tick the tick-by-tick option.

    On YouTube you’ll find a ProRealTime channel with many tutorials.

    #131576

    This is great thank you guys for the prompt reply! I want to develop a trading strategy that is instrument agnostic. So for the backtesting how do I apply the algorithm written above to the various markets like FTSE 100, FTSE AIM etc. Can I only backtest one instrument at a time or can I apply it to the entire market?

     

    As I am not familiar with the abilities or limitations of the Pro Trade system. Can you also clarify whether algorithms can be applied to either individual securities or an entire market similar to how the screener works?

    I have accessed the algorithm tool and it looks as though I can only apply it to one security at a time, please kindly clarify

    Thanks again for you help

    #131577

    Version 10.3 (currently the one supported by IG) only allows 1 instrument at a time.

    Version 11.x (supported by PRT and IB, maybe BINCK as well) allows up to 3 different instruments to be backtested at any one time.

    You will have to duplicate your strategy and name it differently for each instrument.

     

    #131578

    Thanks Roberto for your help

    As I am not familiar with the abilities or limitations of the Pro Trade system. Can you also clarify whether algorithms can be applied to either individual securities or an entire market similar to how the screener works?

    I have accessed the algorithm tool and it looks as though I can only apply it to one security at a time, please kindly clarify

    #131579

    No, algortithms can be applied only to one instrument with v10.3 (see info on the Help menu) and 3 instruments on v11.x.

    If you have v11.x (premium) you can add up to 3 different strategies to your backtest (see atteched pic).

    In any case, whatever version you have you can launch multiple instances of ProBackTest, so on v10.3 you can backtest up to 1, 2, 3 strategies at a time, while on v11.x yoy can backtest up to 3, 6, 9 different strategies at a time.

    PRT have a YouTube channel with many video tutorials about the many features and tools they have.

     

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