Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Mutiple Position exit question

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

    #31
    10-4! Here you are.....thanks!

    Comment


      #32
      Let's try that again.........sorry......
      Attached Files

      Comment


        #33
        Which broker or datafeed are you using? Tested this on Gain for 1 min EURUSD primary chart and did not see an issue, both individual positions are getting reported correctly, one thing I noticed is your Exit call is only working in BarsInProgress context 0, so for the EURUSD.

        Comment


          #34
          I am using GAIN Capital for my feed??? Yes, it will exit the EUR/USD, but not the GBP/USD????? HELP!!!!!!

          Comment


            #35
            edgleliner, either submit the exits in the same manner in which you submitted entries (BarsInPogress check) or explicitly state to which Barsr object to execute to in your ExitLong / ExitShort call -

            ExitLong(int barsInProgressIndex, int quantity,string signalName,string fromEntrySignal)

            ExitShort(int barsInProgressIndex, int quantity,string signalName,string fromEntrySignal)

            Comment


              #36
              This is what I get in the output window when the EUR/USD is down $4 and the GBP/USD is down $3

              EUR/USD is at -3.99999999999956
              GBP/USD is at 0.99999999999989
              Total Profit/Loss is -2.99999999999967

              here is what I get when the EUR/USD is down $5 and GBP/USD was down $4

              EUR/USD is at -4.99999999999945
              GBP/USD is at 0
              Total Profit/Loss is -4.99999999999945


              GBP/USD was down $6 when I cut and pasted this.....
              EUR/USD is at -5.99999999999934
              GBP/USD is at 2.000000000002
              Total Profit/Loss is -3.99999999999734

              Why is the EUR/USD working great, but not the GBP/USD?????

              Comment


                #37
                Originally posted by NinjaTrader_Bertrand View Post
                edgleliner, either submit the exits in the same manner in which you submitted entries (BarsInPogress check) or explicitly state to which Barsr object to execute to in your ExitLong / ExitShort call -

                ExitLong(int barsInProgressIndex, int quantity,string signalName,string fromEntrySignal)

                ExitShort(int barsInProgressIndex, int quantity,string signalName,string fromEntrySignal)
                Could you be more specific??

                Comment


                  #38
                  edgleliner, unfortunately we don't have the bandwith to code out your full script for you - you would need to use the provided overloads that allow for the BarsInProgress parameter so that an exit order is submitted to both of your symbols.

                  Both seems to be working on my end, remember one is updated on each tick, as you add a 1 tick stream.

                  Comment


                    #39
                    I am not sure what you are suggesting???? I don't know how it could be working on your end and not mine???? I do not want to give up on this system as I feel it has a lot of potential with other currencies as well. It is really important to me that I get this base one working, so that I can expand it to the final one(s) that I have in mind. I feel others in this forum will benefit from this once I get it going. Let me know your thoughts........

                    Comment


                      #40
                      edgeliner, to get your idea working I suggested using the more advanced ExitLong and ExitShort call, that allows you to specify which barsobject to exit, thus both positions are exited as you would like to, not only the primary EURUSD one. You would need the calls I posted in my prior post, where the first paramter is the barsinprogress input.

                      Comment


                        #41
                        Originally posted by NinjaTrader_Bertrand View Post
                        edgeliner, to get your idea working I suggested using the more advanced ExitLong and ExitShort call, that allows you to specify which barsobject to exit, thus both positions are exited as you would like to, not only the primary EURUSD one. You would need the calls I posted in my prior post, where the first paramter is the barsinprogress input.
                        Could you show me a specific example?

                        Comment


                          #42
                          ExitLong(0, 100, exitSignalName, entrySignalName);
                          ExitLong(1, 100, exitSignalName2, entrySignalName2);

                          The 0 means place the exit to the primary BarsInProgress.
                          The 1 means place the exit to the secondary BarsInProgress.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #43
                            Thank you Josh!

                            Comment


                              #44
                              NinjaTrader_Josh not clear at all sorry...

                              Hello NinjaTrader_Josh,

                              This concept is very important to understand as it is at the core of everything, not sure why there is not more info on it. For the life of me can not figure out whats going on.... the following code does not seem to clear the longs.

                              This code is in the inner set of bars .....

                              if (GetCurrentBid() < Variable1 && GetCurrentBid() < Variable0 - (TrailStop * TickSize) && Variable2 == 1)
                              {
                              ExitLong(1, (DefaultQuantity / 2), "", "LongDouble");
                              ExitLong(1, (DefaultQuantity / 2), "", "LongStart");
                              Variable2 = 3; // Double down not in effect, wait for new entry to start again
                              Print("Exit Double Long stopped out: "+ GetCurrentBid());
                              }

                              Comment


                                #45
                                Bluepoint, it is hard to comment on that particular piece of code without knowing how the rest of your strategy is set up.

                                If you're sure the code block is executing (does the output window print "exit double long..."?) then I'm guessing that you'll want to change the 1's to 0's for the BarsInProgress index, unless this is a multi-instrument strategy and you seek to exit the long positions for the secondary instrument in which case this code will not help:
                                Code:
                                ExitLong(0, (DefaultQuantity / 2), "", "LongDouble");
                                ExitLong(0, (DefaultQuantity / 2), "", "LongStart");
                                AustinNinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                649 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                370 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                109 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                573 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                576 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X