
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 know that my example looks to be over complicated on the surface, however, I designed it that way so that it could close all open orders/positions in the following way for maximum risk mitigation.
Operation Summary:
Now I see that my code has the same risks as yours. I did not see pending orders in your code. Probably, you did not show the full version.
Now I see that my code has the same risks as yours. I did not see pending orders in your code. Probably, you did not show the full version.
Oh wow... good catch! I posted the completely wrong file! haha. ...sorry
Oh wow... good catch! I posted the completely wrong file! haha. ...sorry
I'm reading now. Without "virtual" I could not immediately understand why such a function.
"override" prompted, but still I would like to see "virtual", too.
Changed some code
I'm reading now. Without "virtual" I could not immediately understand why such a function.
"override" prompted, but still I would like to see "virtual", too.
I'm reading now. Without "virtual" I could not immediately understand why such a function.
"override" prompted, but still I would like to see "virtual", too.
Changed some code
Do you use git?
No, I use only ME.
I fully understood your code. There are some pitfalls that I can not explain due to poor English( I use GoogleTranslate).
OpenTradeSymbol::Size() - this is a poor risk function. Risk(1 lot EURUSD) != Risk (1 lot EURNOK).
Similarly with this function - PendingOrder::Points(). Risk(1 point to openprice pending order EURUSD) != Risk(1 point to openprice pending order EURNOK).
Also, the TP and SL levels are not taken into account when calculating the risk.
But this is all nit-picking, of course, on my part. The logic of your code is easy to read, you're done, thank you.
I fully understood your code. There are some pitfalls that I can not explain due to poor English( I use GoogleTranslate).
OpenTradeSymbol::Size() - this is a poor risk function. Risk(1 lot EURUSD) != Risk (1 lot EURNOK).
Similarly with this function - PendingOrder::Points(). Risk(1 point to openprice pending order EURUSD) != Risk(1 point to openprice pending order EURNOK).
Also, the TP and SL levels are not taken into account when calculating the risk.
But this is all nit-picking, of course, on my part. The logic of your code is easy to read, you're done, thank you.
Thank you very much for taking the time to review my code! I appreciate the feedback. What do you think of the following changes?
"OpenTradeSymbol::Size() - this is a poor risk function. Risk(1 lot EURUSD) != Risk (1 lot EURNOK)."
I agree. I think the best method would be to compute the lots * tick_value
"Similarly with this function - PendingOrder::Points(). Risk(1 point to openprice pending order EURUSD) != Risk(1 point to openprice pending order EURNOK). Also, the TP and SL levels are not taken into account when calculating the risk."
This is the best feedback. I totally forgot to handle remaining stop levels as pending orders! The pending orders class now handles stop levels as pending orders.
I caught a bug in the pending order loop. The list should clear on every iteration.
I also caught a major redundancy and changed the following:
Result