EasyLanguage Question

Discussion in 'Automated Trading' started by flipflopper, Jan 14, 2010.

  1. I this situation what if the market is below a support point?

    Would this just trigger buys for all those orders?
     
    #11     Jan 15, 2010
  2. Also, what if I have say 10 support points under the market and I want to buy at all of them and I don't have enough margin to do so.

    In other words I want my max position to be three units. But if I put buy orders at all the support points I want would theoretically use I generates too many orders.
     
    #12     Jan 15, 2010
  3. Chabah

    Chabah

    I use a "max position" variable to make sure new orders aren't filled beyond a certain amount - but I only have one buy order in play at a time. Could be tricky if all the orders are live, since a rapid move could fill multiple orders. Perhaps an Order Cancels Order structure could deal with this?

    Good luck,

    Damien
     
    #13     Jan 18, 2010
  4. I essesntially want to add a stop and target order once my trade gets executed. Below you can see in simple steps what I want to do.

    1. I want to Buy at a moving average.
    2. I want to set a target 2 points higher.
    3. I want to set a stop 2 points lower.
    4. If either stop or target gets hit I want the corresponding target or stop canceled.

    This doesn't seem to work though. The targets seem to work but not the stops!?!?

    buy("My Buy") next bar (MovingAverageFast) limit;
    sell("My Target") entry("My Buy") next bar (MovingAverageFast + 2) limit;
    sell("My Target") entry("My Buy") next bar (MovingAverageFast - 2) stop;

    Any Easylanguage guys out there have any ideas?
     
    #14     Jan 18, 2010
  5. Code:
    
    buy("My Buy") next bar (MovingAverageFast) limit;
    sell("My Target") from entry("My Buy") next bar (MovingAverageFast + 2) limit;
    sell("My Stop") from entry("My Buy") next bar (MovingAverageFast - 2) stop; 
    
    
     
    #15     Jan 19, 2010
  6. For some reason this still doesn't work.

    The targets get filled just not the stops.

    What happens to the Stop order once the target order gets filled and vice versa? Does the other order get canceled?
     
    #16     Jan 19, 2010
  7. works fine on my end. the orders are oco.
     
    #17     Jan 19, 2010
  8. This is strange. Just contacted tech support for help on this. Thanks PT.
     
    #18     Jan 19, 2010
  9. I was able to resolve this issue. Had to do with having my my stop and target statements in a an if statement that causing problems.

    I have another question.

    I want my program to wait for 5 bars after any position has been stopped out before initiating any new trades.

    Are there any useful functions that can help with this?
     
    #19     Jan 19, 2010
  10. barssinceentry
     
    #20     Jan 20, 2010