Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reference guide for system variable

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

    Reference guide for system variable

    Hi,

    How do I find the document or sample program on the explaination of system variable such as Position, Order etc.

    Position.AvgPrice, GetProfitLoss,MarketPosition,Quantity
    MarketPosition.Flag, Long Short
    order.Name, StopPrice, LimitPrice ....
    OrderState.Accepted, Cancelled, Filled ....

    I cannot find it in NinjaTrader Version 6 Help Guide.


    Regards,
    Toyogo

    #3
    Hi,

    Thanks for that, another question, where can I find the conversion from double to integer etc... The .Net Framework that I found as below doesn't work!!!!


    Public Shared Function ToInt32 ( _
    value As Double _
    ) As Integer

    Regards,
    Toyogo

    Comment


      #4
      Try something like:
      int i = (int) myDoubleValue;

      Comment


        #5
        Hi,

        Thanks. another question, the following setting with default qty = 2 contracts.
        protectedoverridevoid Initialize()
        {

        SetStopLoss(CalculationMode.Ticks, 20);
        SetProfitTarget(CalculationMode.Ticks, 50);
        CalculateOnBarClose =
        true;
        }

        How to change the position quantity after the order filled?

        OnBarUpdate()
        {
        if (condition1) {
        // how to set the quantity = 1
        SetStopLoss(CalculationMode.Ticks, 10);
        SetProfitTarget(CalculationMode.Ticks, 30);
        }
        }

        Regards,
        Toyogo

        Comment


          #6
          To clarify...

          You want to enter with 2 contracts but only send stop/target for 1 of 2?
          RayNinjaTrader Customer Service

          Comment


            #7
            Hi,

            I want to enter 2 contracts, initial stop/target is qty=2. Thus 2 qty will be filled if price goes against the entry and stop out. if price started running then set the 1st set of stop/target for qty=1 on 1st condition; if 1st condition filled then set the 2nd set of stop/target for qty=1 (reminding qty) on 2nd condition.



            Regards,
            Toyoto

            Comment


              #8
              Thanks. The only way you can do that is by using the ExitLong() or ExitStop() type approach vs Set() methods. Then specify the quanty of 2, then change to 1. I believe this should work.
              RayNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              567 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