Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy cannot place trade

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

    Strategy cannot place trade

    In my strategy, i have called a indicator.

    In my indicator
    Code:
    if (State == State.Configure)
    {
    AddDataSeries(BarsPeriodType.Day, 1);
    }
    In my strategy, Even i have added the same dataseries, but still cannot place any trade.

    #2
    Hello soon123,

    Thank you for your post.

    Debugging steps should be taken to monitor the strategy as it is executing to determine why an action has been taken or has not been taken. The first step you should take is to check if there are error messages within the Log tab of the Control Center.

    Then, in order to better understand how the code is working, I recommend adding some debugging prints to your strategy. By adding debugging prints for the values used to evaluate your conditions, outside of those conditions you can observe if the strategy's logic is allowing your order submission methods to fire.

    If you are seeing your order submission being reached, but it is not executing, there may be an issue where the strategy is hitting an internal rule that is not allowing you to re-enter. TraceOrders can be used in the strategy (set in State.SetDefaults or in the Strategy Builder under Default Properties) so it prints its order feedback, and you may also observe the log tab of the Control Center for additional information.

    Some items to check when you are taking debugging steps:
    1. Are your strategy's conditions allowing your order submission methods to be reached?
    2. Is the strategy currently in a position that is preventing it from submitting another entry order?
    3. Do you see any errors in the log tab of the Control Center or do Trace Orders give you any feedback?
    I've included some tips for debugging below.

    Debugging Tips - https://ninjatrader.com/support/help...script_cod.htm

    TraceOrders - https://ninjatrader.com/support/help...aceorders2.htm

    Debugging in the Strategy Builder - https://drive.google.com/file/d/1mTq...w?usp=drivesdk

    Debugging Demo - https://drive.google.com/file/d/1rOz...w?usp=drivesdk

    Please let us know if you have any questions about the debug output you are receiving.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      OK.
      I have tested out.
      There are 3 picture i uploaded :
      - First is the indicator part, i have make a Print there to check whether the line to execute or not
      - Second is the strategy i called that indicator, and i print it out to check the value.
      - Third is the result i get.

      Basically, the value of the bullish[0] / bearish[0] cannot be passed whenever i make a AddDataSeries(BarsPeriodType.Day, 1);

      Comment


        #4
        bullish[0] / bearish[0] are the public Series<bool>.
        They sure can access by the strategy.

        Comment


          #5
          Hello soon123,

          Thank you for your patience.

          Here is a modified example of the SampleBoolSeries strategy and indicator that adds a Daily Data Series for you to compare against your strategy.

          In the attached screenshot we can see that a Buy order was placed based on the indicator's added series meaning that BullIndicator and BearIndicator are returning true.

          Can you confirm that there are no errors in the Log tab of the Control Center? If there are, what do these errors report?

          If you are still hitting issues, please modify the attached example so that it demonstrates your issue(s) clearly.

          Let us know if we may further assist.
          Attached Files
          Brandon H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by RobotSyndicate, Today, 04:27 AM
          0 responses
          1 view
          0 likes
          Last Post RobotSyndicate  
          Started by Ray12345, Today, 04:10 AM
          0 responses
          2 views
          0 likes
          Last Post Ray12345  
          Started by Behungr101, Today, 02:16 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by omermirza, Yesterday, 08:37 PM
          2 responses
          12 views
          0 likes
          Last Post NT-Roland  
          Started by aelagha, Today, 01:28 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Jason  
          Working...
          X