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

 
MaxZ:

I have been using the following design for over half a year now:


Yep, just what I need, thank you.
 
Roll:
MaxZ:

I've got everything right in my EA too, but I still get errors... But everything is right there! Prices are normalized, stops lower BUY, higher SELL, takeprofits higher BUY, lower SELL, RefreshRates() in every line, all variables double... Can you help me? :(

Did you run a search?
What if I'm lazy...? :(
 
MaxZ:
What if I'm lazy...? :(

Laziness is the engine of progress!
 
Roll:

Laziness is the engine of progress!

I'm going to go read The Textbook! :) :) :)


Dimka-novitsek:

Sorry, I wanted to send my EA for real, but it didn't do anything. It turns out he doesn't like stops, error 130.

I tried to put them here, but they are right where I want them. For a pending sell higher and a pending buy lower. Even if by 3000 pips.

By the way, are you aware of the fact that this error indicates not only possible wrong StopLoss levels, but also TakeProfit levels?
 

Thanks!!!!!!

It was 10, though, so I set it to 15 and it didn't work...

 
SeALALex:

Here it is.

Something like a lot of orders are opened by your EA (I was testing EURUSD on H1). And in each of them the lot should increase?

You should first try to get stability out of your EA without all these intricacies. Or maybe you are learning to program in such a way? :D

I have added something. Variables in the beginning of code. And in criterion of opening the next lines:

//~~~~~~~~~~~~Sell~~~~~~~~~~~~~~~~~~~~~~~~
SL=0;
TP=0;
if (MACD1>0 && MACD2>MACD1&& MACD1>(MACDOpenLevel*Point))
{
   if (LastOrder != " Buy ")
      Lots = LotsInitial;
  else
      Lots += LotsStep;
  Buy=true;
  LastOrder = " Buy ";
}

//~~~~~~~~~~~Buy~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if(MACD1<0 && MACD2<MACD1 && MACD2>MACD3 && MathAbs(MACD1)>(MACDOpenLevel*Point))
{
  if (LastOrder != " Sell ")
     Lots = LotsInitial;
  else
     Lots += LotsStep;
  Sell = true;
  LastOrder = " Sell ";
}

Is it me or something is missing in the first condition? And why do you have the signals reversed?

I'm attaching the file...

Files:
 
Dimka-novitsek:

Thanks!!!!!!

It was 10, though, so I set it to 15 and it didn't work...

Does DT allow stops to be set at the opening? Sometimes stops are set only after the opening. Generally, I would put 300 if it didn't work, then I would think about it.
 
The EA started to work when I removed the pauses 20 pips away from the price, no closer!!! I was wondering where error 130 is coming from, from the brokerage server?
 
Thank you, you've helped!!! Because I was only strictly looking at the stops at first...
 
MaxZ:

There are a lot of orders opened by your Expert Advisor (I was testing EURUSD on H1). And in each of them the lot should increase?

You should first try to get stability out of your Expert Advisor without all these intricacies. Or maybe you are learning to program in such a way? :D

I have added something. Variables in the beginning of code. And in criterion of opening the next lines:

Is it me or something is missing in the first condition? And why are your signals swapped?

I'm attaching the file...


Thanks a lot, I told you that I am just learning, can I ask a question LotsInitial - for what purpose? because it builds orders correctly, I do not understand what principle opens an order with such a lot size?
Reason: