[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 369
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
I'm still having trouble figuring out the trading functions, but I know a bit about programming.
it would be good for me to implement this kind of algorithm with your help:
if (buy condition)
if there is an open order
if this order is on the pair in which the buy condition has triggered
if it is a sell order
close it
open a buy order.
Help me write this, I'm getting tired. I've read a lot, I can't understand it yet.
I'm still having trouble figuring out the trading functions, but I know a bit about programming.
It would be good for me to implement this kind of algorithm with your help:
1. if (buy condition)
2. if there is an open order
2.1. if this order is on the pair where the buy condition has been triggered
2.2. if it is a sell order
3. close it
4. open a Buy order.
I have read a lot but I still can't understand it.
1. What is the condition to buy?
2. We make a loop by market orders of the terminal
2.1 In the loop (point 2) we check on which pair the selected order is open and if it is the right one, then ...
2.2. check the type of the selected order and if it is Sell ...
3. Close the selected order
Open Buy order
Or do you need the code completely? This is not a help, but a bearish favor. However... If it does not work - I will write, but no problem...
Yes I have written and helped. and "everyone has their own truth" on this issue.
here is my version
Here's KONDOR's version
The EA still opens trades at every price change when the order opening condition is satisfied.
Another problem with closing orders on a reverse signal (covering a buy order when there is a sell signal and vice versa).
The EA still opens trades at every price change when the order opening condition is satisfied.
Another problem with closing orders on a reverse signal (covering a buy order when there is a sell signal and vice versa).
Hi all. Heard about forex but didn't go into details, I know the basics of C programming.
I want to learn how to program forex robots that would generate income.
Can I really make money on this? What is the minimum prerequisite for starting out? What do I need to learn?
There is another way to do it. Write the ToR (as Sergeev and Composter ask). And then get a working code. In fact, there is a solution to all the problems. And more than once laid out on the forum.
1. The advisor still opens trades on every price change when the condition to open an order is satisfied.
2. Another problem with closing orders on a reverse signal (covering a buy order when there is a sell signal and vice versa).
Prerequisite:
1. If there is a condition to open an order (Buy); If there is no open order (Buy), open a Buy order. Similarly for Sell
2. If there is a condition to open a Buy order, if there is an open Sell order - close Sell.
Thus we obtain:
1. If there is a signal to open a Buy ->> order
2. If there is an open Sell order ->>.
2.1 Close it.
3. If there is no open Buy order ->> 3.
3.1 Open it.
Similarly for Sell