Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Cancelled on Reverse

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

    Order Cancelled on Reverse

    Hi ,
    I developped a strategy and tested it during month...

    First on backtest to improve his performance , next on real-time but on simulated accound. (During one month)

    With the good results I had , I decided last week to make the jump and begin to trade for real...

    I had no problem the first two days with the strategy , but on third days I had cancelled orders...

    I will just explain a little the strategy.

    I trade on Futures , and have 4 different targets.
    So for each enter , I create 4 orders and put Stop loss on each one...
    The targets are managed by the strategy , I'm not using SetProfitTarget for now.

    When a target is reached , I exit one order and modify the stop loss for thoses that stay...

    The strategy can close positions but can also Reverse the positions...
    And it's on that last case that I have a problem...

    It seems it cannot reverse the StopLoss on real account (but it work on simulate account)

    I will not show here the whole algorithm... It's my business

    But The algorithm calls methods GoLong or GoShort in the OnBarUpdate depeinding of course of the logic.

    I attach a code.txt file that contains the GoLong and GoShort method :

    And I attach the log with the cancelled orders...

    I think the problem comes by the fact that I change the stopLoss values before then EnterLong or EnterShort method...

    But has I said , it runs like that on simulated account...
    And I'm a little afraid to put the order EnterLong before giving good values to StopLoss
    If the program crash between the two... I have order on the market without stopLoss...

    Can you please explain me the best way to do that on real account ?

    Thanks
    Attached Files

    #2
    Trumumflu, I see those rejections here in the log posted -

    6/3/2010 9:00:00 AM|1|32|Order='17113811/73679683!RCG!Mirus' Name='Stop loss' New State=Accepted Instrument='GC 08-10' Action=Sell Limit price=0 Stop price=1215.3 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=UnableToChangeOrder Native error='Trigger price must be < last price or last day price'
    6/3/2010 9:00:00 AM|0|32|Trigger price must be < last price or last day price Affected Order: Sell 1 Stop @ 1215.3

    This would mean before submitting the stop at your price x, you should check for it to be a valid stop order, this should also include the inside market (bid, ask - in backtesting you might have checked against the last price only).
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by briansaul, Today, 05:31 AM
    0 responses
    1 view
    0 likes
    Last Post briansaul  
    Started by fwendolynlpxz, Today, 05:19 AM
    0 responses
    4 views
    0 likes
    Last Post fwendolynlpxz  
    Started by traderqz, Yesterday, 12:06 AM
    11 responses
    28 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by PaulMohn, Today, 03:49 AM
    0 responses
    8 views
    0 likes
    Last Post PaulMohn  
    Started by inanazsocial, Today, 01:15 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Jason  
    Working...
    X