Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1805

 
Can I download 32 mt4 to install it on a 64 bit OS system?
 
Seric29 #:
Can I download 32 mt4 to install it on a 64 bit OS system?
yes
 
Seric29 #:
Is it possible to download 32 mt4 to install it on 64 bit OS system?
Well, MT4 x64 doesn't exist at all... And any x32 application can be installed on x64 OS
 
Mihail Matkovskij #:

I've only just noticed.

Index 1.

Whereas you have the MA with an Index of 0! That is, it walks throughout the bar and can go beyond Open and Close. Therefore, it is better to index MA by 1.

Then all the signals will be taken exceptionally on the formed bar and the robot will be fully consistent with the trading system with signals on the open prices. Thus, the robot will only have to track the bar opening (I have already added this code) and enter on the newest bar. It will be more reliable. It will not have to screw around as Makar had to do because of the originally wrong entry algorithm.

Thank you. I am aware of that and will try to run my TS on history with "1".

 
MakarFX #:
Artem, the strategy has one order in the market until it closes at TP or SL.

Gentlemen! Thank you all, but I didn't think my question would generate so much "controversy"))

I am a supporter of EAs, which are as simple as AK-47.

signal - entry

stop/stop/stop-out

trade in one order.

I am using other people's code and adding my own (with your help) and I'm not going to change anything unless it needs changing because it "works and looks simple".

Now I am concerned with a new question

How to make the entry point deviate by n-bars?

bool bSignalBuy()
  {
   if(dMA > Open[1] && dMA < Close[1])
     if (TimeCurrent()> iTime(NULL,0,5)) 
      return(true);

   return(false);
  }
//+-----------------------------------------------------------------------------------------------+
//|                                                             Функция поиска сигнала на продажу |
//+-----------------------------------------------------------------------------------------------+
bool bSignalSell()
  {
   if(dMA < Open[1] && dMA > Close[1])
     if (TimeCurrent()> iTime(NULL,0,5))
      return(true);

   return(false);
  }

That is, I assume that if:

TimeCurrent - arrival time of last quotation > iTime - where "5" Shiftsrelative to the current bar back by the specified number of bars, then the signal has gone.

Something has gone wrong somewhere. as it is not working yet.

 
законопослушный гражданин #:

I've done something wrong somewhere. it's not working yet.

got it all wrong.

try to think - will this condition:

if (TimeCurrent()> iTime(NULL,0,5))

ever return false ?

As for the subject - in the loop from bar 1 to bar iBars(NULL,0) look for a signal, if you found a signal, return the bar number where you found the crossing? or etc.

if you don't find the signal return -1 or maybe INT_MAX .... it depends on how you want to handle the situation if there was no crossover

 
Igor Makanu #:

got it all wrong.

try to think - will this condition:

ever return false ?

As for the subject - in the loop from bar 1 to bar iBars(NULL,0) look for a signal, if you found a signal return the number of the bar where you found the crossing? or etc.

if you don't find the signal return -1 or maybe INT_MAX .... it depends on how you want to handle the situation if there was no crossover

So you want to be "bound" not to time but to the number of bars?

 
законопослушный гражданин #:

So it's not the time that counts, but the number of bars?

well almost.... once again: run in a loop on the signals on each bar.... got it?

for(int i=1;i<Bars;i++)
{
if(dMA < Open[i] && dMA > Close[i]) return(i);
}
return(INT_MAX);
 
Igor Makanu #:

well almost.... once again: run through the signals on each bar.... did you get it?

Yes. explained, I really don't get it yet, why do I need to "cycle" through all the bars?

I have a bar expressed in terms of opening and closing price. It gives a signal to open an order on the next bar.

I assumed that if I expressed the "signal bar" through time instead of price, I could simply add the required amount of time to it and "shift" the position opening time.

 
законопослушный гражданин #:

Yes. explained, I really don't understand why I need to "go through" all the bars?

I have a bar expressed in terms of opening and closing price. It gives a signal to open an order on the next bar.

I assumed that if I expressed the "signal bar" through time instead of price, I could simply add the necessary amount of time to it and "shift" the position opening time.

You have to decide - how do you formulate the question?

law-abiding citizen #:

How to make the entry point retreat by n-bars?

here and look for a bar where the last signal was - to set a hard check signal on bar #5 - is not the best option, imho - look in the loop, if you want, then do the cycle not for all bars, but to for example from 1 to N

By the way: bar, by the way, is a universal solution - now you want on one TF to open an order in 15 minutes, then decide that you need it on a higher TF in 2 hours - knowing the bar where the last signal was, you can immediately get the time of this bar