EasyLanguage Question

Discussion in 'Automated Trading' started by doncello, Feb 13, 2011.

  1. doncello

    doncello

    Hi,

    I want to learn if anyone knows how to cancel a stop order if another stop order has become active in easylanguage backtesting.

    Let say I have given 2 stop orders for next day to buy at today's high and sell at today's low. but I want to cancel 1 order if the other is active.

    For example if price went down and i'm short it shouldn't buy when price turns back and exceeds todays high.

    Thanks..
     
  2. T1P1

    T1P1

    Stop orders are based on conditions.

    Before either order is filled:

    If current contracts = 0 then buy 1 contract at BuyPrice stop;
    If current contracts = 0 then Sell Short 1 contract at SellPrice stop;

    Once either order is filled the other order is no longer active.

    You can use the same logic to place a stop after an entry:

    If Market Position > 0 then sell current contracts at StopPrice Stop

    The new TradeStation 9.0 has smart order classes/objects/tickets that make all of this much easier.


    cheers

    T1P1
     
  3. I have a problem with text_delete in easy language.
    I need to update a text so I check for its existence, then delete it by text_delete and finally write the new text by text_new.
    The problem is text_delete fails sometimes and from that point on all text disappears.

    Any thoughts?