Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Number of contracts in "if" statement

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

    Number of contracts in "if" statement

    Is there a way to put the number of contracts as a condition in an if statement?

    if(Position.MarketPosition == MarketPosition.Long && "number of long contracts is 3 ")
    {
    ..........
    }

    #2
    Hello cosmin1ke,

    Thank you for your note.

    Yes, you could utilize Position.Quantity to get the number of contracts. Here is an example:

    if (Position.MarketPosition == MarketPosition.Long && Position.Quantity == 3)
    {
    // do something
    |

    For more information about Position.Quantity:


    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
    72 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    143 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    76 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    47 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    51 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X