Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Entries witn an ATM Strategy

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

    Multiple Entries witn an ATM Strategy

    I have a strategy working based on the sample ATM strategy. I am getting entries as I expect but the problem is I am getting multiple entries. When placing the strategy on the chart what should the setting be to prevent multiple entries for the strategy in the same direction? (I currently have "Entry handling" set for unique entries since that is what worked for the earlier version of this strategy which used named entries for multiple contract trades.) Should it actually be: AllEntries?

    Also, in the Sample ATM Strategy, which part of the code checks to see if there is already a strategy in place?

    Thanks
    DaveN

    #2
    Hi daven,

    Yes, "AllEntries" is what you'll want to use here.


    Can you clarify "which part of the code checks to see if there is already a strategy in place?" When you submit a strategy, there is no default method to check if there is one running already.
    TimNinjaTrader Customer Service

    Comment


      #3
      Is there another way to see if I have a strategy running already that i could place in the code prior to entering a new strategy? I am getting multiple strategy entries in both directions and it is really a mess. I've tried running the strategy with Entry Handling in both modes (unique entries, and all entries) and it doesn't seem to make any difference. I don't want to enter another trade until the previous entry is closed out. That is what i need to check for.
      Thanks
      DaveN

      Comment


        #4
        Let me clarify my question. i already had in the code the following condition:

        "Position.MarketPosition == MarketPosition.Flat"

        I did this to ensure that I didn't enter a new trade until the previous trade was flat either by profit targets or a stop out. That condition is still in my code after converting it to entering an ATM order instead of a straight long or short entry, but it appears that condition no longer works? If I check in my trade logic if I am long, short, or flat, since I have launched an ATM strategy and my entry is now being controlled by the named ATM, am I unable to determine my current position?
        DaveN

        Comment


          #5
          I think I found what I am looking for but I want to make sure I understand how to use it. The first line of the quote sample below...if(ordirId.Length == 0 && atmStrategyId.Length == 0.... appears to be a test to see if there is already an active ATM Strategy running. Is that correct? If so, what happens with this test if I am running two different ATM strategies on two different charts? Will they interact and possibly detect one another's presence? I don't want to know if there is any active ATM strategy running anywhere, I just want to know if there is one active on the particular chart I am running this strategy on. I don't know if what I am asking is clear, if not, let me know and I'll try to phrase my question more intellilgently.
          Thanks
          DaveN


          if (orderId.Length == 0 && atmStrategyId.Length == 0
          && High[1] >= MAX(High, MMHiLo_LB)[2]
          && High[0] < High[1]

          Comment


            #6
            Hi daven,

            For this you can use GetAtmStrategyMarketPosition()
            TimNinjaTrader Customer Service

            Comment


              #7
              Okay, I've incorporated that last command in and commented out the orderid length and atmstrategy id length test out, so we'll see how it runs no. Am I correct in my interpretation that if I do the orderIdlength == 0 and AtmStrategyId.Length == 0 test I am looking for any atm strategy running on any chart, (not just the one the current strategy is running)/
              Thanks
              DaveN

              Comment


                #8
                Just an update here. It appears that adding that getatmposition test has helped greatly. I still got one additional entry resulting in a double position so I have more work to do, but so far it is a lot better. I am looking at output in an output window to see what is going on but for some reason I am getting this endless stream of tic information, (example below).
                Any idea what that is coming from ? It is not there because of anything I have set in this strategy and it is really interfering with my ability to see what is going on in the program. Any idea how I can stop it?
                Thanks
                DaveN

                7/23/2010 11:05:19 AM size of tick 4 DIR 1
                7/23/2010 11:05:19 AM size of tick 4 DIR 1
                7/23/2010 11:05:19 AM size of tick 1 DIR 1
                7/23/2010 11:05:19 AM size of tick 1 DIR 1
                7/23/2010 11:05:19 AM size of tick 5 DIR 1
                7/23/2010 11:05:19 AM size of tick 5 DIR 1
                7/23/2010 11:05:19 AM size of tick 1 DIR 1
                7/23/2010 11:05:19 AM size of tick 1 DIR 1
                7/23/2010 11:05:19 AM size of tick 1 DIR 1
                7/23/2010 11:05:19 AM size of tick 1 DIR 1
                7/23/2010 11:05:20 AM size of tick 1 DIR 1
                7/23/2010 11:05:20 AM size of tick 1 DIR 1
                7/23/2010 11:05:20 AM size of tick 1 DIR 1
                7/23/2010 11:05:20 AM size of tick 1 DIR 1
                7/23/2010 11:05:20 AM size of tick 4 DIR 1
                7/23/2010 11:05:20 AM size of tick 4 DIR 1
                7/23/2010 11:05:20 AM size of tick 4 DIR 1
                7/23/2010 11:05:20 AM size of tick 4 DIR 1
                7/23/2010 11:05:20 AM size of tick 1 DIR 1
                7/23/2010 11:05:20 AM size of tick 1 DIR 1
                7/23/2010 11:05:20 AM size of tick 1 DIR 1
                7/23/2010 11:05:20 AM size of tick 1 DIR 1
                7/23/2010 11:05:20 AM size of tick 1 DIR 1
                7/23/2010 11:05:20 AM size of tick 1 DIR 1
                7/23/2010 11:06:00 AM size of tick 1 DIR -1
                7/23/2010 11:05:20 AM size of tick 1 DIR -1
                7/23/2010 11:05:20 AM size of tick 1 DIR -1
                7/23/2010 11:05:20 AM size of tick 3 DIR -1
                7/23/2010 11:05:20 AM size of tick 3 DIR -1
                7/23/2010 11:05:20 AM size of tick 22 DIR -1
                7/23/2010 11:05:20 AM size of tick 22 DIR -1
                7/23/2010 11:05:20 AM size of tick 1 DIR -1

                Comment


                  #9
                  Hi daven,

                  This is in the output window? Do you have any Print()'s in your code that could explain it?
                  TimNinjaTrader Customer Service

                  Comment


                    #10
                    Yes, it is in the output window and I do have print statements like this one:
                    [QUOTE][Print(counter + " " + "Executing ATM_Buy");
                    Print(PT_BarColorMapper_Mod3(5).BCMText[0] + " " + PT_BarColorMapper_Mod3(5).BCMText[1] );/QUOTE]

                    But nothing putting out tic information or anything like that. I am mystified because I can see nothing running that would account for this kind of data going into the output window. Is there some kind of generic setting somewhere in the options that could create this kind of repetitive output?

                    Comment


                      #11
                      Found it.

                      I found the culprit. A friend of mine wrote an indicator which sorts out block trades and prints them in the upper corner of the chart. It is a very cool indicator because you can see when large size starts to pile in the market either buying or selling and if the size is big and fast enough it can move the market. It broadcasts tics and that is what is going into the output window. I will see if there is a way to suppress that function without ruining the indicator which is really cool.
                      Thanks for your help.
                      DaveN
                      Attached Files

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by DJ888, 04-16-2024, 06:09 PM
                      4 responses
                      12 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Started by terofs, Today, 04:18 PM
                      0 responses
                      11 views
                      0 likes
                      Last Post terofs
                      by terofs
                       
                      Started by nandhumca, Today, 03:41 PM
                      0 responses
                      7 views
                      0 likes
                      Last Post nandhumca  
                      Started by The_Sec, Today, 03:37 PM
                      0 responses
                      3 views
                      0 likes
                      Last Post The_Sec
                      by The_Sec
                       
                      Started by GwFutures1988, Today, 02:48 PM
                      1 response
                      9 views
                      0 likes
                      Last Post NinjaTrader_Clayton  
                      Working...
                      X