[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 285
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
You can do it manually. Right-click and then... :)
You can apply a script or an Expert Advisor. Which do you prefer? XD
I'm writing an EA that puts pending orders and works on a channel break...can you help?
Set orders and catch trades, as soon as the pendent becomes a market maker delete all pending orders for that symbol/magic. Just as a refresher http://www.kimiv.ru/index.php?option=com_remository&Itemid=13&func=fileinfo&id=36
Set orders and catch trades, as soon as the pendent becomes a market maker delete all pending orders for that symbol/magic. For the background http://www.kimiv.ru/index.php?option=com_remository&Itemid=13&func=fileinfo&id=36
It is better to look through a textbook, and Kim has many functions.
Here is a rough plan: loop all orders through ordertotal and orderselect, make sure the symbol coincides with the current one and check the magik (if needed). Then we should look at the order type, if it is a market order, increment the number of market orders, if it is a pending order, increment pending orders. After that there will be two numbers, let's say if there is one pending then delete all the pending orders.
It is better to look through a textbook, and Kim has many functions.
Here is a rough plan: loop all orders through ordertotal and orderselect, make sure the symbol coincides with the current one and check the magik (if needed). Then we should look at the order type, if it is a market order, increment the number of market orders, if it is a pending order, increment pending orders. After that there will be two numbers, let's say if there is one pending then delete all the pending orders.
The code is two parts. .This is my expert. Please have a look at it.
This is the first time I've created arrays and I do it like this
and it gives me an error.
'}' - comma or semicolon expected
What's wrong?
This is the first time I've created arrays and I do it like this
and it gives me an error.
What's wrong?
Arrays can only be initialised with constants.
This is the first time I've created arrays and I do it like this
and it gives me an error.
What's wrong?
From the moving average, take CalculateCurrentOrders(Symbol()), it returns values = number of open orders, filtered by symbol and magic, with sign = direction of transaction: for example -1 means 1 order in sale. If needed, use MathAbs() to ignore the sign.
From the above code, take the trailing stop:
// check for trailing stop - here, there are even comments.
if(TrailingStop>0) { ... }, it is in 2 places - for buying and selling. Everything is simple. Or, you can use ready-made functions of Igor Kim's. There is a special colour here. They are more universal and correct for real trading, but also a little more difficult to understand for a beginner. If you have a good faith in the new version, you will get a better trading robot.
p.s. For debugging, use Print(), it helps a lot.
Please help a beginner. How to write this code section:
Check market orders and if there are no market orders for our financial instrument, then buy?
I can't do it!!! Help... Maybe someone has a ready code fragment?