Allow only one strategy to execute a trade

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #34609 quote
    algotrader
    Participant
    Average

    Hello Team

    I want to run few strategies simultaneously.

    However, I want to allow only one strategy to execute a trade (Which comes first)..

    So strategies X,Y,Z are running..
    If X has been executed a trade, then Y and Z can not execute even though the strategy condition been met.

    Any ideas?

    Thanks,
    A.

    #34653 quote
    GraHal
    Participant
    Master

    Put a suggestion to PRT using the Suggestion Box form below.

    Seems like a good idea … reduces worry of High Drawdowns and Margin Calls.

    Suggest also that PRT have a drop down box to select 1, 2, 3, more etc Bots running at same time.

    Let me know if you do / don’t it else I’ll put it in? 😉

    GraHal

    PS More I think about, it’s a great idea … we could have loads of Bots running Live, but know that when we wake in the morning only 1 or 2 etc could be trading?

    Okay we may miss big profits on one Algo by taking a earlier trade on another Algo, but I can live / sleep with that! 🙂

    #34656 quote
    GraHal
    Participant
    Master

    I forgot the link to the Form Doh! 😉

    https://www.prorealtime.com/en/contact?suggestion=1

    #34664 quote
    algotrader
    Participant
    Average

    Ok, Thanks.
    So I’m guessing there is no way to program this at this stage..??

    that’s a bit lame.

    This is a basic risk management.

    Anyway, I have sent them a message.

    Thanks,
    A.

    #34667 quote
    AutoStrategist
    Participant
    Veteran

    This is a basic risk management.

    Hi algotrader, you are absolutely right, I have put this on here in the suggested improvements and filled out the form and sent it direct to IT-Finance, the more of us who do that the sooner we will get this essential functionality.

    #34674 quote
    algotrader
    Participant
    Average

    Great stuff!!

    The more the merrier..
    😉

    A.

    #34686 quote
    robertogozzi
    Moderator
    Master

    You can assembly all of your strategies into a bigger file.

    “DEFPARAM CumulateOrders = false” will do the hard job!

    Of course you may need to name variables in different ways, say, a1s1  or cond1s1 for the first strategy, then a2s1/cond2s1….. a1s2/cond1s2 for the second strategy etc….

    You may name a variable StrategyID = 0 when NOT ONMARKET, the set it to any number you want each buy/sell is executed so you know which strategy was triggered.

    Example:

    DEFPARAM CumulateOrders = False                                 //Only 1 trade at a time
    
    IF NOT OnMarket THEN                                            //Make sure you reset this variable to ZERO when not trading
       StrategyID = 0
    ENDIF
    //-----------------------------------------------------------------------------------------------------------------
    IF (StrategyID = 0) OR (StrategyID = 1) THEN					//Strategy 1
       s1.... = ......
       .
       .
    ENDIF
    //-----------------------------------------------------------------------------------------------------------------
    IF (StrategyID = 0) OR (StrategyID = 2) THEN					//Strategy 2
       s2Avg = Average[20](close)
       s2Rsi = Rsi[14]
       .
       .
       .
       //************************************************************************
       //                                 LONG
       //************************************************************************
       IF close CROSSES OVER s2Avg  THEN
          StrategyID = 2
          SET TARGET PPROFIT 20
          SET STOP PLOSS     10
          BUY nLots CONTRACT AT MARKET
       ENDIF
       //************************************************************************
       //                                 SHORT
       //************************************************************************
       IF close CROSSES UNDER s2Avg  THEN
          StrategyID = 2
          SET TARGET PPROFIT 20
          SET STOP PLOSS     10
          SELLSHORT nLots CONTRACT AT MARKET
       ENDIF
       .
       .
       .
       .
    ENDIF
    //-----------------------------------------------------------------------------------------------------------------
    IF (StrategyID = 0) OR (StrategyID = 3) THEN					//Strategy 3
       s3.... = ......
       .
       .
       .
    ENDIF
    
    Nicolas and Inertia thanked this post
    #34690 quote
    Nicolas
    Keymaster
    Master

    Thanks Roberto, it is a great idea.

    However, I agree that this feature (ProOrder strategies that can communicate with each other) is a must to build successful portfolio and use rebalancing method. I already put this idea into my own wish list (and in prorealtime hands) and I’m looking forward to get this feature soon .. or late 🙂

    robertogozzi and soulintact thanked this post
    #34861 quote
    algotrader
    Participant
    Average

    Thank Nicolas
    That is important.
    Keep us informed about the progress.

    Cheers,
    A.

    #93104 quote
    soulintact
    Participant
    Senior

    Will this feature be included in version 11? Thanks!

    #96977 quote
    GraHal
    Participant
    Master

    so you know which strategy was triggered.

    Maybe coffee not woke brain yet, but when I look in my Auto-Trading window at Running Systems then how would I know which Strategy within a Multi-Strategy Auto-System had triggered the trade?

    #96980 quote
    robertogozzi
    Moderator
    Master

    What you want to achieve is impossible till PRT support communications among strategies themselves and among them and PRT.

    This is was intended to assemble multiple strategies into a single one, mainly to overcome bracket margins by IG, you can only tell which strategy entered a trade from within the same code.

    GraHal thanked this post
    #97036 quote
    GraHal
    Participant
    Master

    you can only tell which strategy entered a trade from within the same code.

    I’m still intrigued by this and cannot work out how how when a trade executes and I look in the code how would I know which strategy (out of multi-strategies) had triggered the trade.

    You may name a variable StrategyID = 0 when NOT ONMARKET, the set it to any number you want each buy/sell is executed so you know which strategy was triggered.

    Only way I can think of would be to also have the code running on Backtest and GRAPH the StrategyID variables and then I could see which StrategyID number had triggered.  Is that how to do it Roberto please?

    #97040 quote
    robertogozzi
    Moderator
    Master

    Yes GraHal, that’s exactly what I do.

    GraHal thanked this post
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.

Allow only one strategy to execute a trade


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
algotrader @algotrader Participant
Summary

This topic contains 13 replies,
has 6 voices, and was last updated by robertogozzi
6 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/05/2017
Status: Active
Attachments: No files
Logo Logo
Loading...