Vondereich
CG Top Poster Club

- Messages
- 23,951
- Joined
- Jan 11, 2008
- Messages
- 23,951
- Reaction score
- 951
- Points
- 176
Den ada guna etasoft forex generator ni nak buat ea..
Masalah dia, bila MA crossing, dia bukak sekali dua entri. Satu buy satu sell serentak..
Sblm tu dah mmg letak teknikal dia dan syarat2 dia cross. tapi on skali dua..
bila den tgk manual dia suruh letak if order does not exist la apa la. sama je.. sapa tau camna nak solve ??
Masalah dia, bila MA crossing, dia bukak sekali dua entri. Satu buy satu sell serentak..
Sblm tu dah mmg letak teknikal dia dan syarat2 dia cross. tapi on skali dua..
bila den tgk manual dia suruh letak if order does not exist la apa la. sama je.. sapa tau camna nak solve ??
Multiple Orders Problem
Let say you setup simple diagram with "On Every Tick" block having two branches. Each branch with a "Technical Analysis 2"
blocks to check for moving average cross up/down each having attached "Sell Order" or "Buy Order" to it. You are using moving
averages to check for cross on current bar. You expect to see single order open when cross happens.
Instead you are sometimes getting multiple orders open on what appears as single cross. This is usually called "multiple order"
problem. While this may seem like a defect in the EA, it is not. It is because of current value of moving average changing you are
getting multiple crossing signals for the setup that suppose to report only one cross up or cross down.
In other words, it is because of the way terminal works - current values are not "frozen", they are changing.
If you use current bar for indicator calculation understand that current bar is not "frozen" and it is changing all the time until new
bar starts to form at that point current bar gets frozen and is no longer changing. Same applies to Close, Low and High values. So
for example current Close, Low and current High are not fixed.
Because current bar is not frozen what you see on the chart as single "cross up / cross down" might be multiple cross ups and
cross downs. Therefore EA receives multiple "cross up / cross down" signals. From EAs point of view there have been multiple
signals (multiple cross ups or downs).
Now there are few ways to prevent multiple orders opening in this case.
You can:
1. Tell EA to check if there are other orders already open with that same OrderId and OrderType and then do not open anymore
orders if such already exists. This is usually done with "If Order Does Not Exist" block.
2. Tell EA to open new orders only once per bar. So if EA gets "cross up / cross down" signal it will open new order only once per
bar. This is done by placing "Once per Bar" block after your technical analysis and just before where you open new order.