Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buy and sell workflow sequence

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

    Buy and sell workflow sequence

    My strategy enters and exits trades smoothly until the sequence is broken by 2 exit short commands that are out of sequence. when this happens the Strategy stops working until I stop and start the strategy to return the 3 Bools to true that controls the logic of the workflow

    I have a print enter and exit commands on every step of the workflow so as the logic passes through the 4 sets of the strategy builder I can trace the progress on the alerts log.

    On the chart I can see the plot activations and see buy - sell then sell - buy. but sometimes sell - buy to cover ?
    Is this throwing the sequence out and how can I check what is going on?
    Attached Files

    #2
    Hello fredfred123,

    Thank you for your note.

    I will need to see your log and trace for today look further into this inquiry.

    Could you please send an email to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and attach the log and trace files for the day in subject which you can find in My Documents>NinjaTrader>Log and My Documents>NinjaTrader/Trace folders.

    I look forward to your message.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hi Alan

      The exact time and date is noted on the alert log on the attachment I sent in the first email, hope that helps.

      I think what you described could well be happening, but I do not understand why I get an enter short order, and then 2 exit short commands ?
      In what you described could be happening would I be correct in saying there is more than 1 trade to go short.

      I have in the workflow apposing a buy or sell the code
      if(IsFirstTickOfBar)
      {
      DoOnce = true;
      }
      The reason for putting this code in the workflow was to stop multiple trades being made as the market price jitters over the strategy entry point.
      to allow only one trade per bar, could this be preventing further progress in the workflow if the short command involves 2 trades ?

      The new bar may not be refreshing the workflow as if what you described is happening as it could be now out of sequence?

      Understanding that there may be 2 calls and I have limited each bar to one, the first trade works than the strategy stops until I turn the strategy off and back on to reset it.
      could a new bar refresh the sequence in the workflow?

      I’m a recent pupil of ninjascript so beginning to understand the process and exact syntax is a bit hazy

      Comment


        #4
        This is what is happening.

        Strategy sells short, then trade reverses and goes long and Strategy exits trade with a buy to cover.

        On the Alerts log I get Enter short and then exit Short, then on the next green bar I get the 2nd exit short.

        I have enclosed 2 screen shots of this happening. The second exit short on the screen shot of the Alerts log coincides with the new green bar on the chart screenshot.

        The strategy will now be frozen until I restart it and will work till the next trade and so on.
        When I restart the strategy it will be yellow state until it goes flat.

        A solution to this would be greatly appreciated
        Thanks in advance
        Attached Files

        Comment


          #5
          Hello fredfred123,

          Thank you for writing in.

          I would suggest adding print statements to check when or whether your conditions are becoming true. I’ve provided a link to a youtube video which covers an example of using prints to understand behavior:

          Dive into manipulating C# code from within an unlocked NinjaScript strategy using the NinjaScript Editor.NinjaTrader 7 is an award winning end to end online ...


          I’ve provided a link covering debugging which you may find helpful.
          Debugging: http://ninjatrader.com/support/forum...ead.php?t=3418

          If you’d like to send a copy of the strategy you’re running, I can take a look and see if anything jumps out.

          To export a NinjaScript from NinjaTrader 8 do the following:

          From the Control Center window select Tools -> Export -> NinjaScript...
          Click Add>Select the indicator>OK>Export.
          Then attach that file you saved; under My Docs>NT8>Bin>Custom>Select the downloaded .zip file.

          Please let us know if you need further assistance.
          Alan P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CortexZenUSA, Today, 12:53 AM
          0 responses
          1 view
          0 likes
          Last Post CortexZenUSA  
          Started by CortexZenUSA, Today, 12:46 AM
          0 responses
          1 view
          0 likes
          Last Post CortexZenUSA  
          Started by usazencortex, Today, 12:43 AM
          0 responses
          5 views
          0 likes
          Last Post usazencortex  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          168 responses
          2,265 views
          0 likes
          Last Post sidlercom80  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          11 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X