I this situation what if the market is below a support point? Would this just trigger buys for all those orders?
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.
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
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?
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;
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?
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?