• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get EntryPrice of trade?

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

    How to get EntryPrice of trade?

    I have several EnterLong() commands, with different names...

    Code:
    for (i=0; .....){
        MyTrades[i] = EnterLong("MyLong"+[i]....);
    }
    for each of them, i want to exit them if the price goes below their entry price, how to do that?

    Position.AvgPrice is quite inappropriate, as it doenst have any parameter to reference to a specific trade (like MyTrades[i].Position.AvgPrice ??) , so, it doesnt know on which trade I am reffering, so it couldnt give me entry price for each LongEntries...
    how to achieve what i want?

    #2
    Hello selnomeria,

    Thanks for opening the thread.

    You are already using IOrder objects, so I would suggest to use the AvgFillPrice property of the IOrder object. You can also assign unique names to the the IOrder object through the signal name so you can identify the IOrders in your container/array.

    IOrder object properties can be referenced here: https://ninjatrader.com/support/help...htm?iorder.htm

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AspenHiker, Today, 08:37 AM
    0 responses
    1 view
    0 likes
    Last Post AspenHiker  
    Started by dshalom9, Today, 08:36 AM
    0 responses
    1 view
    0 likes
    Last Post dshalom9  
    Started by StarTrader, 07-11-2020, 11:27 AM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by rtwave, Yesterday, 04:11 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by sachin shetty, 07-11-2020, 08:49 PM
    1 response
    21 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Working...
    X