Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLong Doubt...??

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

    EnterLong Doubt...??

    i have to Enter long for every 50 price down ... but how to enter another long with out closing the previous long ...

    #2
    Hi Deall, it would depend on your EntryHandling settings used, you can definitely scale into a position - http://www.ninjatrader.com/support/f...ead.php?t=3751

    Comment


      #3
      hi

      i want to print the LongPrice for every Long entered is that possible PositionAvgPrice giving the average price .. but i need the individual long price separately

      Comment


        #4
        If you need the individual execution prices of your orders making up the position I would suggest checking into the IOrder objects offered for more advanced programmers - http://www.ninjatrader.com/support/h...ightsub=IOrder

        Comment


          #5
          hi can u give syntax for that or any sample code to get value of the Longprice using IOrdrers

          Comment


            #6
            Would unfortunately not have a specific example for your case here handy, but generally for working with the IOrders and the advanced order management approach I consider this here to be ideal - http://www.ninjatrader.com/support/f...ead.php?t=7499

            Comment


              #7
              Originally posted by DealI View Post
              hi can u give syntax for that or any sample code to get value of the Longprice using IOrdrers
              The IOrder syntax in the NT Help documents all the supported properties. In this case, you are looking for the AvgFillPrice property. Access it with standard OOP syntax.
              Last edited by koganam; 05-30-2013, 01:50 AM. Reason: Corrected spelling.

              Comment


                #8
                thanks for ur reply koganam

                but how to define wit standard OOPs can pls tell in detail . i tried but it showing error

                Comment


                  #9
                  Originally posted by DealI View Post
                  thanks for ur reply koganam

                  but how to define wit standard OOPs can pls tell in detail . i tried but it showing error
                  What did you write, and what is the error message?

                  Comment


                    #10
                    hi i have one doubt
                    #region Variables
                    private IOrder entryOrder = null;

                    protected override void OnBarUpdate()
                    {
                    .....
                    ...
                    ....

                    if( entryOrder == null && c <= b)

                    {
                    entryOrder = EnterLong();

                    Print("a=" + entryOrder.AvgFillPrice);

                    }

                    everything flows correctly and executes but

                    for a= entryOrder.AvgFillPrice as i mention in print commd .. its not printing the value just printing 0 y its not printing the price value

                    Comment


                      #11
                      Originally posted by DealI View Post
                      hi i have one doubt
                      #region Variables
                      private IOrder entryOrder = null;

                      protected override void OnBarUpdate()
                      {
                      .....
                      ...
                      ....

                      if( entryOrder == null && c <= b)

                      {
                      entryOrder = EnterLong();

                      Print("a=" + entryOrder.AvgFillPrice);

                      }

                      everything flows correctly and executes but

                      for a= entryOrder.AvgFillPrice as i mention in print commd .. its not printing the value just printing 0 y its not printing the price value
                      At the time that the Print statement is executed, immediately after the entry, the order is unlikely to have been filled, so the AvgFillPrice would be zero.

                      You probably want to check this when you have a position, so check for that first.

                      Code:
                      if (Position.MarketPosition != MarketPosition.Flat)
                      {
                      //do stuff here;
                      }
                      As an aside, it is not a program error if you do not get what you expect. As you can see, there was no error message here.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      647 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      369 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      108 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      572 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      573 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X