[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 62

 

Good day to you all!

Please advise newbie

344272288 2011.07.25 01:21 buy 0.01 gbpchf 1.3267 0.0000 1.3062 2011.08.08 18:02 1.2373 -0.09 0.00 0.00 -11.79

5732040 so: 9.3%/1.1/12.0

Did I get suckered in?

The thing is that the order closed on its own without my involvement!

I wonder if it was a sinking, is there any way to protect myself from it?

 
Solree:
Roger is right, it's fine if you select the order again after closing.
So the error is in my interpretation... But I don't think "every variable is assigned a value"...
 

Hi all!

I've written an indicator that produces an Alert under certain conditions. The problem is that as long as the condition is met, it gives alerts without end. How can I limit the condition so that no more than 1 - 2 alerts are issued?

 

somewhere like this

static bool flag=true;
if(ваше условие)
{
if(flag)
{
Alert;
flag=false;
}
}
else flag=true;
 
WTL:

Hi all!

I've written an indicator that produces an Alert under certain conditions. The problem is that as long as the condition is met, it gives alerts without end. How can I limit the condition so that no more than 1 - 2 alerts are issued?

//Алерт не чаще одного раза в две минуты...
static datetime atime=0;
if (индикатор)
if ((TimeCurrent()-atime)>120)
{
atime=TimeCurrent();
Alert;
}
 
Roger, splxgf, thank you! Crossed both conditions and it worked out great.
 

Hi all. Guys I have a condition to find maximum: but within a corridor.

for (int max=1; max<1000; max++)
if (High[max+1] < High[max] && High[max] > High[max-1] && Low[max+1] < Low[max] && Low[max] > Low[max-1] &&
High[max] > low_level_s && High[max] < high_level_s) break;

it does not work.

if I remove the corridor It's ok:

for (int max=1; max<1000; max++)
if (High[max+1] < High[max] && High[max] > High[max-1] && Low[max+1] < Low[max] && Low[max] > Low[max-1] ) break;

What could be the problem?

I understand that max<1000 should be increased, I tried it but it didn't work.

 
sergey_r:

Hi all. Guys I have a condition to find the maximum: but within the corridor.

for (int max=1; max<1000; max++)
if (High[max+1] < High[max] && High[max] > High[max-1] && Low[max+1] < Low[max] && Low[max] > Low[max-1] &&
High[max] > low_level_s && High[max] < high_level_s) break;

it doesn't work.

If I remove the corridor It's fine:

for (int max=1; max<1000; max++)
if (High[max+1] < High[max] && High[max] > High[max-1] && Low[max+1] < Low[max] && Low[max] > Low[max-1] ) break;

What could be the problem?

I understand that max<1000 needs to be increased, tried it but it didn't work.


I suggest changing the values of low_level_s, high_level_s.

 

Here is an example in numbers:

1. 4100<1.4150<1.4200

but 1.4150 should hit the low_level_s = 1.4145, high_level_s = 1.4155 . In this example it did.

But if it is not, let's assume that it is 1.4160, then let's go further. The problem is that this high may be 3 years ago, for example. The program cannot find it.

What to do?

 
What can I do if it goes over 999? Is there any way to get it out of the quote archive?
Reason: