Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 helpwanted, Today, 03:06 AM
      1 response
      14 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      11 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      6 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      244 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      387 views
      1 like
      Last Post Gavini
      by Gavini
       
      Working...
      X