Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

command required to print the current position to the output window?

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

    command required to print the current position to the output window?

    I am able to implement the MarketPosition function because I have only to copy the example from the UserGuide and maybe slightly modify it.
    I am now trying to print to the output window the position itself.

    I have no understanding of VB structure and syntax so please tell me the command required to print the current position to the output window. I have unsuccessfully tried various modifications of Position.MarketPosition.

    #2
    Originally posted by joemiller View Post
    I am able to implement the MarketPosition function because I have only to copy the example from the UserGuide and maybe slightly modify it.
    I am now trying to print to the output window the position itself.

    I have no understanding of VB structure and syntax so please tell me the command required to print the current position to the output window. I have unsuccessfully tried various modifications of Position.MarketPosition.
    Without seeing your code in question, I can only offer up what NT HELP suggests:

    Examples

    Code:
    Position
        
     
    
    Definition
    
    The Position object holds data related to a currently held position by a strategy.
    
     
    
    Methods and Properties
    
    AvgPrice
     Gets the average entry price of the strategy position
     
    GetProfitLoss()
     Gets the unrealized PnL
     
    MarketPosition
     Gets the current market position
     
    Quantity
     Gets the current position size
     
    
     
    
     
    
    Examples
    
    protected override void OnBarUpdate()
    {
        // Print out the average entry price
    
        Print("The average entry price is " + Position.AvgPrice);
    }

    Comment


      #3
      it worked....thanks

      thanks Sledge
      Position.MarketPosition is one combination I must not have experimented with.

      the following worked:
      Print(
      "The market position is " + Position.MarketPosition);

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      566 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      548 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X