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

 
artmedia70:

Judging by the comment on the screenshot - you are controlling the zero bar to make decisions.

This is not good... On a zero bar, indicators can go back and forth many times during bar formation, thus creating false signals (jitter).

To avoid this, check the first bar already formed.


i.e. for accurate PRICE_CLOSE calculation, it is reasonable to use the 1st and subsequent bars?

am I right?

but if you use PRICE_OPEN you can use 0 bar

check code 0 bar

bool NewBar()
{
static datetime lastbar = 0;
datetime curbar = Time[0];
if(lastbar!=curbar)
{
lastbar=curbar;
return (true);
}
else
{
return(false);
}

 
Ivn:


i.e. for an accurate PRICE_CLOSE calculation, it is reasonable to use the 1st and subsequent bars?

am I right?

and if you use PRICE_OPEN you can use 0 bar

the code of the 0 bar check

bool NewBar()
{
static datetime lastbar = 0;
datetime curbar = Time[0];
if(lastbar!=curbar)
{
lastbar=curbar;
return (true);
}
else
{
return(false);
}

This function returns a flag to open a new bar. How does it relate to the price that is used to calculate the indicators?

It doesn't...

 
The expected payoff is -2.11 (negative) when testing with 0.1 lot a deposit of 10,000. Is it true that if I reverse the condition I get a profitable system or is this not the case?
 
artmedia70:

This function returns a flag to open a new bar. How does it relate to the price used to calculate the indicators?

none...


Right.

but a question.

i.e., to accurately calculate the PRICE_CLOSE price, it is reasonable to use the 1st and subsequent bars?

am I right?

and if I use PRICE_OPEN then I can use 0 bars?

 
Ivn:

Right.

but a question

i.e. for an accurate PRICE_CLOSE calculation, it is appropriate to use 1 and subsequent bars?

am I right?

and if PRICE_OPEN is used then 0 bars can be used?

Yes
 
artmedia70:
Yes

Thank you
 
YOUNGA:
The expected payoff is -2.11 (negative) when testing with 0.1 lot a deposit of 10,000. Is it true that if you reverse the condition you get a profitable system or is this not the case?

It is not.

The MO you have is equal to minus the spread with a tail (assuming that the spread is equal to two points). The system can be further manipulated, if its MO is at least two or three times the spread... That is, in your case and assuming that the spread is two pips, the MO must be greater than 5.

 
artmedia70:

Wrong.

Your MO is minus the spread with a tail (assuming the spread is two points). The system can be further manipulated if its MO is at least twice or three times the spread... That is, in your case and assuming that the spread is two pips, the MO must be greater than 5.

spread of 2 with a four-digit spread?
 
Skydiver:

Why use a cycle if only 1 bar is taken? Just use 1 instead of "bar". Only check for new bars so that you don't have to recalculate everything on every tick.
Even if you change it to 1, it still gives wrong data.
 
ilunga:

one more time.

the simplest version (schematic)


Thank you for the schematic.

It would be great if my orders were of one currency pair. But I have a multi-currency EA for 8 pairs + condition to buy or sell them, i.e. I have 16 tickets. My Expert Advisor is working at every new bar opening, closes all orders, checks the conditions and sells or buys currencies. It is not a problem during the day but it is not profitable to close and reopen orders in one direction during flat.

Do I need to work with arrays or is it easier to put such a ticking scheme on every pair?

Reason: