Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AtmStrategy generated by StrategyCreate()

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

    AtmStrategy generated by StrategyCreate()

    When using the Example Code for GetAtmStrategyStopTargetOrderStatus() I expected the "Average fill price" to be the average Price of the Stops or Targets depending on which was specified. I also expected the "Filled amount" to be the QTY
    They always come back zero. Is there a way to Read back the Stop/Target values in case they were manually moved.

    Thanks


    protected override void OnBarUpdate()
    {
    string[,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", "idValue");

    // Check length to ensure that returned array holds order information
    if (orders.Length > 0)
    {
    for (int i = 0; i < orders.GetLength(0); i++)
    {
    Print("Average fill price is " + orders[i, 0].ToString());
    Print("Filled amount is " + orders[i, 1].ToString());
    Print("Current state is " + orders[i, 2].ToString());
    }
    }
    }

    #2
    Ok, So these values were not what I thought they might be. I found that out by looking at the Control Center Orders Tab. So what I need to read back is the Limit Prices of the Working ATM Stops. Is there a way to do that ?

    Thanks
    Jerry

    Comment


      #3
      Hello,

      Thank you for the question.

      This would actually not be possible using NinjaScript to determine the limit price for an ATM strategy target. The methods that are available in the help guide would be the only items that can be used with ATM strategies in a NinjaScript strategy. Because of the way ATM strategies work with NinjaScript, the Execution and other order information is not reported directly to the strategy like you would have using standard NinjaScript order methods.

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

      Comment


        #4
        Bummer,
        It only seems logical that if you let a strategy trigger an ATM Strategy you would provide abilities for both
        manual and Automatic control. When running a Strategy it is often that you can see more than you can program at least in my case and thus want to modify a position in some fashion while still retaining features of the automatic control. Manually you see more, Automatically the program can react much faster especially in fast markets. I will just have to disable auto when I modify - not perfect but it will work.

        Thanks
        Jerry

        Comment


          #5
          Jesse,
          I know this is a long shot but I have to ask, If orders were generated by a strategy can you see them and modify them manually with Chart Trader and be able to read the Stops or targets back to sync with the Strategy ?

          Comment


            #6
            Hello,

            Using the chart trader with a Automated strategy is actually something that is not recommended and in ways will disable the strategy if used at the same time.

            When you modify a stop using the chart trader that a strategy has placed, the strategy has no way to know this. As an example if you have a strategy that submits a stop and you manually change the stop, the next time the OnBarUpdate is called, if the stop order is re submitted it will be at the strategy price and not your manual change. If you were to close an order the strategy would disable as well.

            In general manual trading and Automatic strategies can not be combined aside from using the ATM strategy way that is in place.

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

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by AttiM, 02-14-2024, 05:20 PM
            11 responses
            184 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by fernandobr, Today, 09:11 AM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by timmbbo, Today, 08:59 AM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by KennyK, 05-29-2017, 02:02 AM
            2 responses
            1,281 views
            0 likes
            Last Post marcus2300  
            Started by itrader46, Today, 09:04 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Working...
            X