
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
Hi Vladimir,
I am having the same problem, my code doesnt work.
I tried every variation, including part of your code. The RSI signal is working. I am suspecting now it is never called, but dont know how to test that. Any tips please?? I would also hire someone to help me.Error # 1
Wrong cycle.
for(int i=0; i<PositionsTotal(); i++)
You need this:
Mistake # 2 and # 3: first you need to check the signals and if there is a signal, then call the close function. Like that:
*** if(CloseBySignal && RSI_tpLong()) ClosePositions();
Error # 1
Wrong cycle.
You need this:
Thank you very much for the reply. I got this from a mql5 article:
and it does work. I use it also in other parts of my EA and it works.
What does not work is the PositionClosePartial. It keeps partial closing of the position until it is closed completely. What I want however is to partial close the actual position only once.
Update, I found a simple solution:
Thank you very much for the reply. I got this from a mql5 article:
and it does work. I use it also in other parts of my EA and it works.
What does not work is the PositionClosePartial. It keeps partial closing of the position until it is closed completely. What I want however is to partial close the actual position only once.
Update, I found a simple solution:
Be careful when you are told.
When closing a position, use the loop:
Be careful when you are told.
When closing a position, use the loop:
Thanks again Vladimir, but that code doesnt work in my Hedge system. Would you have a code base reference for your return open positions loop please ?
This code works in both Hedge and Netting
nuance: you need to connect trade classes and declare objects -
This code works in both Hedge and Netting
nuance: you need to connect trade classes and declare objects -
Hi Vladimir,
Your code works now also in my EA in the Strategy Tester, but not in real time. It closes the position but not at the correct RSI value. I suspect it might be my RSI signal. I looked into your RSI EA and see that you are using two values. Can you please explain why. This is your code in case you dont remember:
Thank you!
Hi Vladimir,
Your code works now also in my EA in the Strategy Tester , but not in real time. It closes the position but not at the correct RSI value. I suspect it might be my RSI signal. I looked into your RSI EA and see that you are using two values. Can you please explain why. This is your code in case you dont remember:
Thank you!
If you misused my code, it is not my fault. My code works both in the tester and online.
I said for a long time: if you want to get the correct code, let's start from the very beginning. Let's create an Expert Advisor step by step. But you prefer torment :)
Hi Vladimir,
Your code works now also in my EA in the Strategy Tester, but not in real time. It closes the position but not at the correct RSI value. I suspect it might be my RSI signal. I looked into your RSI EA and see that you are using two values. Can you please explain why. This is your code in case you dont remember:
Thank you!
That code is right. So what's the issue you have with two values rsi_0/1, it's just the way it has to be done.
Well, I am one of those guys who want to understand the code I am using and why I am using it. Other programmers used RSI differently, i.e. using only one value.d
If you misused my code, it is not my fault. My code works both in the tester and online.
I said for a long time: if you want to get the correct code, let's start from the very beginning. Let's create an Expert Advisor step by step. But you prefer torment :)
No,I dont. I am just a 73 year old "do it my way" hardware engineer, who spent most of his life in financial markets and btw is married to a Russian. I try to improve the EA I got delivered from a professional developer without one word of comment. I developed an iPhone app 10 years ago. Before that a Fortran program 50 years ago. So I am a bit rusty. As I said already I would appreciate to get some help with the PCSv9 I am using and which sometimes does not open a position and I cant figure out why. So my chart paints that signal dot, but apparently I am missing the signal. That is also why I was asking for your RSI code.
This is how I get the values:
So what all is wrong with above code?
Thank you!