[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 544

 
merkulov.artem:


Thanks a lot for the tip. Does it work only on Vista or 7 too?

Created the profile a long time ago, didn't know about the dot. Tried to edit it a long time ago and diligently, it gives error "Link does not work". I wrote to the support, no answer. So I accepted it, it fulfills its main function :)

It says FROM Vista.
 
Dimka-novitsek:

Hello again!

1. Imagine, where the hell did the last expert disappear to? Here's what's left.

2. Is it possible to get it back!


Good morning!

1. You drive that kind of money! It's high time you got yourself a stand-alone cam with an in-net line! IMHO! (When not alone at the computer - such removal is not surprising, most likely someone steamed, but it does not matter - the code is demolished ...) Then again, how can it be (without the fudge) that the code is almost wiped and the "Save" button is pressed (floppy disk at top left)? Even if someone wiped something out out out of haste, why save it? Again, keep in mind that when writing a program, you need to perform an intermediate save, and in this case, continue with them (by loading the final version of the intermediate (final - is if the program is finished) save).

2. You can't.

 

Hi all!

I have finalised my first expert. The original task was to get my idea right in the form of code.

I am asking you to take a look at my EA and give your opinion.

Thank you very much for your help in writing the EA!

The Expert Advisor logic is as follows:

-The price breaks through the RSI level (1 condition),

-Then using a flag it fulfills the second condition (breaking the high or low in n bars)

-I also introduced a function to avoid opening of a second order while the first one is open.

Once again, the aim was to write an EA correctly. Please point out my mistakes and deficiencies.

I thank you in advance.

Files:
proboitrsi.mq4  12 kb
 
Thank you!
 
Pacman:

Hello all!

I have finalised my first expert. The original task was to get my idea right in the form of code.

...

Decided here to poke around in your code a bit.

1) What is missing is init() and deinit(),

2) This:
for(int i=1; i<=OrdersTotal(); i++)
      {
       if(OrderSelect(i-1,SELECT_BY_POS)==true)
         {
          if(OrderSymbol() == Symb)
            {
             if(OrderMagicNumber()==777)
                return;
            }    
         }   
      }

you can do it this way:

if (OrdersTotal()>0)
{  for (int i=OrdersTotal()-1; i>=0; i--)
   {  if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
      {   if(OrderSymbol() != Symb) continue;
          if(OrderMagicNumber() != 777) continue;
          return;
      }
   }
}

3) This.

Symb=  Symbol();
...
Min_Lot= MarketInfo(Symbol(),MODE_MINLOT);
...
Steep=   MarketInfo(Symbol(),MODE_LOTSTEP);

write in init(), it is enough to define them once at initialization, not every tick, because"function call takes more time than variable reference".

4) The logic of this post is not clear to me

while(true)
...

When while can it be false?

This is just a little bit that directly caught my eye.

 
paladin80:

Decided to poke around in your code a bit.


3) These.

put in init(), it's enough to define them once at initialization, not every tick, because "function call takes more time than variable reference".


Just don't forget that in init() market environment is not always available
 
Vinin:
Just don't forget that market environment is not always available in init()
You know that there is always a solution to the "tricky s***" - the right value is obtained through a loop.
 
TarasBY:
You know there is always a solution to the "tricky s***" - you get the right value through a loop.

There are time constraints for init() function
 

Evening.

The EA monitors several pairs in several frames. How to make it react not only to ticks of the pair/window it is attached to, but to ticks in all pairs. Thank you!

int start()

{

double MA50 [4][9];

double OBarHigh [4][9];

double OBarLow [4][9];

for (int t=0; t<=3; t++) // timeframe

{

for (int p=0; p<=8; p++) // pair

{

MA50[t][p]=iMA(pair[p],tframe[t],50,0,MODE_EMA,PRICE_CLOSE,0);

OBarHigh [t][p]=iHigh(pair[p],tframe[t],0);

OBarLow [t][p]=iLow(pair[p],tframe[t],0);

 
imux:

Evening.

The EA monitors several pairs in several frames. How to make it react not only to ticks of the pair/window it is attached to, but to ticks in all pairs. Thank you!



Maybe a looped EA would help