Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

check to see if I'm inside market

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    check to see if I'm inside market

    Hello,

    I’m trying to find a way to control my strategy. I would like my strategy not to enter the market if a position is already open, because currently I see that several positions are opened at the same time. I tried to put a check like:

    if(Position.MarketPosition == MarketPosition.Flat{
    // other check for my strategy and then in case it enters to market}
    else{
    return;
    }

    but there’s still more positions open at the same time, and that’s something I want to avoid. Is there any other way to check that you are not already within the market?​

    Thank you!

    #2
    Hello angelvincent37,

    Thank you for your post.

    I suggest adding print statements to your script to better understand what is happening. For more information about using prints to debug a script:


    Additionally, you may set up the strategy's properties to only allow one entry per direction and this could also help prevent additional entry orders from being submitted. If you plan to base the entry handling on UniqueEntries, then you will need to be sure to use signal names for your entry orders within your script. For more information about the available strategy properties:


    Please let us know if we may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    59 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X