Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reverse order not working

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

    Reverse order not working

    I'm working a very simple strategy that should always keep me in the market. Problem is when I tell it to reverse, it just closes the position out and does not enter an order in the other direction. I had thought from the documentation that if I was Long and told it to go short, it would close out the Long, then get into a Short postion of the same amount... Any ideas/suggestions would be much appreciated.

    Basically the code is:

    if(x>y)
    {
    EnterLong(25,000, "L1") ;
    } else {
    EnterShort(25,000,"S1") ;
    }

    I'm using IB as a broker and below is a trace of the last order (was Long):

    11/30/2009 06:15 Position Instrument='$GBPUSD' Avg price=0 Quantity=0 Market position=Long Operation=Remove Currency=UsDollar

    11/30/2009 06:15 Execution Execution='$GBPUSD/0000d344.9625eb61.01.01' Instrument='$GBPUSD' Exchange=IBIdealPro Price=1.6476 Quantity=25000 Market position=Short Operation=Insert Order='892541465' Time='11/30/2009 06:14:59' Multiplier=1E-05

    11/30/2009 06:15 Order Order='892541465' Name='S1' New State=Filled Instrument='$GBPUSD' Action=SellShort Limit price=0 Stop price=0 Quantity=25000 Type=Market Filled=25000 Fill price=1.6476 Error=NoError Native error=''

    11/30/2009 06:14 Order Order='892541465' Name='S1' New State=Working Instrument='$GBPUSD' Action=SellShort Limit price=0 Stop price=0 Quantity=25000 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''

    11/30/2009 06:14 Order Order='892541465' Name='S1' New State=Accepted Instrument='$GBPUSD' Action=SellShort Limit price=0 Stop price=0 Quantity=25000 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''

    11/30/2009 06:14 Default Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed. 2109

    11/30/2009 06:14 Order Order='NT-00060' Name='S1' New State=PendingSubmit Instrument='$GBPUSD' Action=SellShort Limit price=0 Stop price=0 Quantity=25000 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''

    #2
    Your understanding of the Enter() methods is correct, they would reverse your current open position automatically - have you synched up the account position with the strategy position as you took it live?

    BertrandNinjaTrader Customer Service

    Comment


      #3
      After checking my current Strategy position, it says " - " which seems to agree with what you are saying. I closed out the position with the broker, then reentered it via the DOM. My problem could have been that when I tried to manually sync the postion (previously), I did it via the broker interface NOT with NT.
      I'll watch this and see what happens, hopefully, this will do it. Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by alifarahani, Today, 09:40 AM
      6 responses
      31 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      17 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by Kaledus, Today, 01:29 PM
      5 responses
      14 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Waxavi, Today, 02:00 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by gentlebenthebear, Today, 01:30 AM
      3 responses
      17 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X