One strategy/position at a time

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #83500 quote
    snaajpern
    Participant
    Senior

    Hi,

    First of thank you for all the help i’ve gotten from the forum throughout my coding with PRT!

    I have several strategies running in the same instrument; with different timeframes and logic. My problem is when they all open positions at or around the same time – my total positon count is to high for my preference.

    My question: is there a way for one strategy to know if there are any open positions in the instrument belonging to another strategy, and preferably count them? or any other way to limit the amount of contracts or positions in the instrument at the same time?

    Thank you for your answer(s),
    Rasmus

    #83502 quote
    Vonasi
    Moderator
    Master

    Strategies are completely independent of each other so the answer is that there is no way for one strategy to know how many positions another one has open.

    #83506 quote
    robertogozzi
    Moderator
    Master
    #83509 quote
    Vonasi
    Moderator
    Master

    The link does not work for me Roberto.

    Maybe this one will?

    Allow only one strategy to execute a trade

    I’d forgotten that thread – I seem to recall us discussing this somewhere before and the only down side to your code was that you would need to list the strategies in some sort of order of priority from best to worst as strategy 1 is given first opportunity to have its conditions met and if they are then strategies 2 and 3 and so on are ignored.

    #83523 quote
    robertogozzi
    Moderator
    Master

    Links don’t work for me either. You have to select them, then copy the selction to the clipborad and paste it in the browser.

    As for my post… yes, you need to assign them a priority, in case more than one starategy has conditions met. But if you have 6 strategy and want at most 2 of them open trades at the same time you just have to allow multiple trades (via DEFPARAM CUMULATERORDERS=TRUE) then count trades and only stop when the maximum is reached.

    #83688 quote
    snaajpern
    Participant
    Senior

    Thank you for your answers Robert and Vonasi!

    Guess all strategies in one code is the solution ATM.

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

One strategy/position at a time


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
snaajpern @snaajpern Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by snaajpern
7 years, 4 months ago.

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