[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 315

 
It turned out that an unlimited number of orders were opened on a new bar. before they were all opened at once, but now one is expected to open and all the others are opened.
 
GarKain:
If you want to learn, then it's a straightforward way to either give up the project or use a programmer.


Are you trying to correct someone else's code? If so, you have to break it down to understand every letter. Otherwise it will be even harder for you. Better yet, write your own code. That way you know what's what, where an error might occur, how to catch it and how to fix it.

If you have such problems with your own code, then I've done the right thing - download Roche's course (link above) and start by creating scripts. It won't get any faster. And your work for you to do no one will. If there is no desire to learn - then this is a straightforward way to either give up the idea or hire a programmer.

 
there are 6 types of timeline scale in Metatrader. Is there a function that returns the scale number?
 
silhouette:
there are 6 types of timeline scale in Metatrader. Is there a function that returns the scale number?

Period() - see here and here
 

Hello! The indicator draws arrows when the curves cross, I have transferred this signal through iCustom to the EA. But positions open either up or down-

Depending on the check for the signal: at first both on buy and on sell was db/ub == 0 opens only long trades, after the signal became db!=1 and ub!=0 opens only short positions

I put db!=0 and ub!=!0 trades do not open at all. Honestly, I do not know what to do, dug the indicator, the Expert Advisor, but the reasons for "malaise" I can not find.

Give advice, please!

// ----- буферы индикатора

double   ArrowDownBuffer[];
double   ArrowUpBuffer[];

//------ получение сигнала в советнике


double db=iCustom(NULL,0,"GetSignal",0,SignalBar);// Стрелка вниз
double ub=iCustom(NULL,0,"GetSignal",1,SignalBar);// Cтрелка вверх
 
 
 bool BuySignal=false;
 bool SellSignal=false;
 
//-----------------------------------------------------------------------------------+
//Проверка на сигнал
if(db!=1)
 {
  SellSignal=true;
 }
if(ub!=1)
 {
  BuySignal=true;
 }
   
 
drknn:

Period() - see here and here

No, I mean magnifying glass (+, -) - scale on a horizontal scale.
 
silhouette:

No, I mean magnifying glass (+, -) - scale on a horizontal scale.

Nope, not in MQL4
 
skyjet:

Hello! The indicator draws arrows when the curves cross, I have transferred this signal through iCustom to the EA. But positions open either up or down-

Depending on the check for the signal: at first both on buy and on sell was db/ub == 0 opens only long trades, after the signal became db!=1 and ub!=0 opens only short positions

I put db!=0 and ub!=!0 trades do not open at all. Honestly, I do not know what to do, dug the indicator, the Expert Advisor, but the reasons for "malaise" I can not find.

Please advise, please!


Quite a strange check

//Проверка на сигнал
if(db!=1)
 {
  SellSignal=true;
 }
if(ub!=1)
 {
  BuySignal=true;
 }

if(db!=1)? then this is a short signal. And if in this case db will contain zero? After all, the inequality will become true and it will also be a signal?

How can you give advice if no one knows what you have in your code? And the bit you cited - it's just initialization of variables with indicator values. Well, look, the up arrow is drawn. In idea, the indicator buffer "up arrow" should contain the price of the arrow, but the other one (the buffer "down arrow") should be empty on this candlestick (by idea). But what your reality is, God only knows...

 
drknn:


Quite a strange check

if(db!=1)? then it is a short signal. And if the db will contain zero? After all, the inequality will become true and it will also be a signal?

How can you give advice if no one knows what you have in your code? And the bit you cited - it's just initialization of variables with indicator values. Well, look, the up arrow is drawn. In idea, the indicator buffer "up arrow" should contain the price of the arrow, but the other one (the buffer "down arrow") should be empty on this candlestick (by idea). But what your reality is - God only knows...

Yes, the indicator has 2 arrow price buffers from which I am trying to get a signal. But in vain, because no matter what combination I try, either only long positions open or

or only short positions open, or nothing at all. The indicator has only 2 external variables which are arrow price buffers.

I cannot understand how it is possible to open trades in one direction but not in two.

if( bs==1 && bs!=EMPTY_VALUE )
 {
  BuySignal=true;
 }
if( ss==1 && ss!=EMPTY_VALUE )
 {
  SellSignal=true;
 }
 
double db=iCustom(NULL,0,"GetSignal",0,SignalBar);// Стрелка вниз
double ub=iCustom(NULL,0,"GetSignal",1,SignalBar);// Cтрелка вверх

if( ub!=0 && bs!=EMPTY_VALUE ) //стрелка вверх не равна нулю или пустому значению (то есть,она существует)
 {
  BuySignal=true;
 }
if( db!=0 && ss!=EMPTY_VALUE )//стрелка вниз не равна нулю или пустому значению (то есть,она существует)
 {
  SellSignal=true;
 }
Have you tried this?
Reason: