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 FrancisMorro, Today, 03:24 AM
      0 responses
      1 view
      0 likes
      Last Post FrancisMorro  
      Started by Segwin, 05-07-2018, 02:15 PM
      10 responses
      1,769 views
      0 likes
      Last Post Leafcutter  
      Started by Rapine Heihei, 04-23-2024, 07:51 PM
      2 responses
      30 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by Shansen, 08-30-2019, 10:18 PM
      24 responses
      943 views
      0 likes
      Last Post spwizard  
      Started by Max238, Today, 01:28 AM
      0 responses
      10 views
      0 likes
      Last Post Max238
      by Max238
       
      Working...
      X