Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Repetitive Sell orders with no position

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

    Repetitive Sell orders with no position

    When testing my strategies out on live simulation I keep getting a message telling me the strategy is getting a sell signal but there is no position.

    I have tried setting a bool to the buys or sells and added testing the bool value in each sell condition, I have also tried using current position long\short = true as a condition and I still get the message almost constantly.

    This happens in 2 different strategies through the builder.

    Is this from having stops set?
    Last edited by Ryan333; 05-29-2024, 10:53 AM.

    #2
    Hello Ryan333,

    Thank you for your post.

    Can you post the exact error message you are getting?

    Comment


      #3
      Thanks for the quick reply! I'm currently headed back home and will post it word for word, should be about 2 hours or so.

      Thanks again!

      Comment


        #4
        This is the error I'm getting. Thanks!

        Comment


          #5
          Hello Ryan333,

          Thank you for your post.

          This message will appear when your strategy calls ExitLong or ExitShort but no position exists to exit. You can check the current strategy position by checking the Position.MarketPosition. You may need to add checks for an actual position before calling ExitLong()/ExitShort().



          For example,

          Code:
          if(Position.MarketPosition == MarketPosition.Long && <Exit conditions here>)
          {
          ExitLong();
          }
          Please let us know if you have any further questions. ​​

          Comment


            #6
            Is there a way I can add this command in the strategy builder, or does it have to be done with coding?

            Comment


              #7
              Hello Ryan333,

              You can create a condition like this in the Builder. Please see the screenshot which shows an example of checking if your strategy is currently in a long position.

              Attached Files

              Comment


                #8
                Thanks looks like it worked! Could you help me under stand why my bool variable = true wasn't doing the same thing? I may not be understanding them properly. I will have to check my other strategy, I thought I already tried this exact thing as a condition, but I may be wrong.

                Thank you for all of this! I should be getting close to done bugging you for the day

                Comment


                  #9
                  Hello Ryan333,

                  I'm not clear on what FirstSell = true is doing in the context of the strategy. If you are wondering why the script wasn't working as expected that way, it will be necessary to use Print to see how the conditions are evaluating and enable TraceOrders to see if orders are being submitted, ignored, rejected, or cancelled.

                  Below is a link to a forum post that demonstrates using prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.


                  Enable TraceOrders, print the time of the bar and all values used in the conditions that submit entry orders. Include labels for all values and comparison operators.

                  Let me know if you need any assistance creating a print or enabling TraceOrders.

                  Save the output from the output window to a text file and provide this with your reply.

                  I'll be happy to assist with analyzing the output.​

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  557 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  324 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
                  545 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  547 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X