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 not really an expert on this.
But the assumption is that if after the 1st signal you 'hang' the flag, then let it hang.
Even if the 1st signal is already exhausted!
Then the 2nd signal will give a signal to open without any problem.
If I understood the question correctly...
But the flag is a variable, as I understand it, and with a new tick the program will see the initial or newly calculated flag value. Maybe I misunderstand what a flag is?
But a flag is a variable, as I understand it, and with a new tick the program will see the initial or calculated value of the flag from the new data. Maybe I misunderstand what a flag is?
A flag is a boolean constant which has a value true or false, with a numeric representation of 1 or 0 respectively.
If the condition of the 1st signal (like crossing 2 wheels) then the flag is set to true, if the crossing has not yet occurred flag remains false! For your task... it would look something like this :
bool signal1=true;
int start()
if (signal1==false) {return();}
signal1 ......... tra la get signal
if (signal1 ==true) //the first signal appears
{
signal2 .............. tra la receiving signal
signal1=false;}
something like that should happen )))
oh, as I was writing, it was already defined below)But a flag is a variable, as I understand it, and with a new tick the program will see the initial or calculated value of the flag from the new data. Maybe I misunderstand what a flag is?
I can add, that globally declared variables save their values.
>> until they are forcibly changed or the program is closed.
The protection of the flag is done as follows:
By the way// функция принятия решения и установки флага
can be anywhere, depending on the author's idea, the sequence of actions changes.
The protection of the flag is done as follows:
by the waycan be anywhere, depending on the author's idea, and it changes the sequence of actions.
>>Thank you all, seems to have figured it out))
Good evening. Trouble has come down from somewhere.
An advisor with a martingale.
10 steps. At each step the position has a different magician.
At the beginning everything was working fine. For several days.
However, all of a sudden it did not work at all!
The very first position opens and immediately, on the next bar, it closes!
It is unclear why.
And it goes on and on. Opens and closes.
It just started today. All of a sudden !
Here's the closing block :
Maybe someone will see the inaccuracy or error ? (by prices of opened positions)
rid писал(а) >>
It is not clear why.
Will anyone suddenly see any inaccuracy or error?
The problem is probably not with this code, but with opening positions or calculating TakeProfit_Buy. It is more likely that it is the latter.
If it plays in the tester, Print should help.
I do not calculate TakeProfit_Buy - I just set it in external parameters.
In the tester - the same crap.But in places. At first, all is normal.
And then this shit appears. And not always.
I'll have to insert a comment or a print...
Besides. I have never tried to use this kind of magic when I was a rookie, but I have never forgotten.
I think I've got it wrong. And, of course, not at all where I was originally looking.
Apart from the above closure, I also have this one:
It turns out that the function flag after its execution equals 1, but after all other positions have been closed it still equals 1 !And of course, when the next first position with magic number = magic number is opened - it is immediately closed !
It's just not clear why this error didn't show up for two days ?
//--------------------------------------------------------------
Also. Can you advise me, - How can I make this block work correctly after all ?
In other words, how to reset function isCloseLastPosByTake() after closing all positions?
In other words, how do I reset the isCloseLastPosByTake() function after all positions have been closed?
As far as I understand, the opening time of a position closed on profit should be longer than that of the remaining small orders, add this condition and everything will be cool.