[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 337

 
I don't understand the two actions. Once done and forgotten. It will always be automatically called during visual testing, except when you make a template with the name of the EA being tested. In the latter case, the tester will select it.
 
granit77:
I don't understand what two actions are. Once done and forgotten. It will always be automatically called during visual testing, except when you make a template with the name of the EA being tested. In the latter case the tester will select it.

Yes, you're right. Checked it out - it really does work AT ONCE. Thanks

 
gisip:

You have an error here, you get the same thing four times.


Reworked it, but nothing has changed. Maybe it's not the right way ?

//--------------------------------------------------------------- 5 --
   // Торговые критерии
   int A= ADXbars;
   int B= CountBars;
//-------------------------------------------------------------- 5a --
   double L_1=iCustom(NULL,0,"ADX Crossing",A,B, int b4plusdi, 0);
   double L_2=iCustom(NULL,0,"ADX Crossing",A,B, int nowplusdi, 0);
   double L_3=iCustom(NULL,0,"ADX Crossing",A,B, int b4minusdi, 0);
   double L_4=iCustom(NULL,0,"ADX Crossing",A,B, int nowminusdi, 0);
//-------------------------------------------------------------- 5b --
   if (L_1>L_3 && L_2<L_4)
     {
      Opn_B=true;                               // Критерий откр. Buy
      Cls_S=true;                               // Критерий закр. Sell
     }
   if (L_1<L_3 && L_2>L_4)
     {
      Opn_S=true;                               // Критерий откр. Sell
      Cls_B=true;                               // Критерий закр. Buy
     }
//--------------------------------------------------------------- 6 --
What else should I look at ?
 
Can you tell me (for some reason no one answered on page 335 - or the question is totally stupid), which constants are responsible for "long" and "short" items in EA settings? I.e., in the sense that by their value true / false SELL and BUY are printed in large letters:)
 
sergeev:
maybe not in mt4?

Aren't Insta Trader and MT4 the same thing?
 
Pyro:
Can you tell me (for some reason no one answered on page 335 - or the question is totally stupid), which constants are responsible for "long" and "short" items in EA settings? I.e., in the sense that by their value true / false SELL and BUY are printed in large letters:)
Frankly speaking - I don't understand what I want... I personally don't understand what and in what cases it should be output . Except for SELL and BUY in capital letters. Be more specific.
 

artmedia70


Well, in Expert Advisor settings there is a drop down menu for what Expert Advisor does, sells or buys or both. I have an Expert Advisor consisting of two parts (buy / sell). I have two variables - bool sell and bool buy. I set through external to set which sections of my EA works. I want to set some values in main settings of my Expert Advisor (first tab). For example, I use IsTradeAllowed() to read checkbox "allow EA to trade". How about short / long settings ?

 
Why does the EA on EURUSD immediately close the correctly opened position, not obeying the indicator, although it works fine on other pairs. There is no SL or TP to blame. Alpari DC.
 
Pyro: And here are the short / long settings ?

There is no program access to these properties of the EA configuration window, but I think it is easy to implement a ban on trading in an undesirable direction in the EA code

yosuf:
Why does the EA on EURUSD immediately closes the correctly opened position, not obeying the indicator, while it works fine on other pairs? I have not specified SL or TP so I do not want to blame them. Alpari DC.
If you look at the EURUSD Expert Advisor, it has the same effect as other symbols, only EURUSD usually has the lowest spread, it is hard to guess what is wrong with it without the code
 
yosuf:
Why does the EA on EURUSD immediately close a correctly opened position, not obeying the indicator, although it works fine on other pairs. There is no SL or TP to blame. Alpari DC.

To learn what to start with, please give me a piece of the log, where the opening and, in your opinion, wrong closing takes place.
Reason: