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

 
Good evening!!! Help, please! I need to mute the sound in Metatrader, all of it. At the root. Not under any circumstances, no way. I've already deleted the sounds folder, where all the sounds are stored, and it's
 
dkfl.zrjdktdbx:
Good evening!!! Help, please! I need to mute the sound in Metatrader, all of it. At the root. Not under any circumstances, no way. I've already deleted the sounds folder, where all the sounds are stored, and it's


But seriously, look in the settings. I recently, literally, found a sound control.

 
FAQ:

It's this way: https: //www.mql5.com/ru/job


I don't want to go there.

I want to learn.

so I repeat the question. "any beginner's question".

how do you make a range of an EA work? let me explain.

we draw a line, rename it "buy_down".

draw a second line, rename it "buy_up".

and allow the EA to trade only between these lines.

 
TESKATLIPOKA:


I don't want to go there.

I want to learn.

So, you demonstrate what you have already written. And indicate what the difficulty is. They'll tell you.

Otherwise, you should either go to a textbook or to where the FAQ sent you.

 
PapaYozh:

So, you demonstrate what you have already written. And indicate what the difficulty is. You will be advised.

Otherwise, it's either a textbook or the FAQ.


Thanks. Noted. It would be desirable to give specific advice, not a hint.

//+------------------------------------------------------------------+
//| line.mq4 |
//| |
//| | ||
//+------------------------------------------------------------------+
//--- input parameters
extern bool sell = 1; // permission to sell
extern bool buy = 1;
extern double lots = 0.1;
extern int sl = 50;
extern int tp = 150;

extern int order = 10; //

extern double bez = 15;
extern double tral_step = 15;
extern double tral_start = 10;

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
string sell_stop ="sell_stop";
string buy_stop ="buy_stop";

//buy------------------------------------------------------------------------------------------------

// find line and place order when price touches
if (ObjectFind (buy_stop) > 0 ) // if line buy_stop exists.

// it does, but the line should touch the price. be equal to the price. but I don't know how to do this correctly


{
OrderSend (Symbol(),OP_BUYSTOP, lots, Ask+Point*order,3, Bid-sl*Point, Bid+tp*Point );// the order is being sent
ObjectDelete (buy_stop); // the line is being removed
}

//----
return(0);
}

 
Is it possible to set an EA to restart after a specified time. i.e. it is removed from the chart and put back on after 10 minutes?
Or maybe the metatrader should be restarted.

or something like a clearing of history.
I would like to have the EA start with a clean slate after some time, so I wouldn't need to manually remove it from the chart and put it back,
but I would like it to restart itself. If it is certainly possible.


And another question, how to do it right or maybe someone has a function that prohibits trading on holidays and maybe on Fridays?
It means to set up a time interval before holidays when no new orders should be opened and old ones will be closed by themselves.
For example, do not trade from the 20th of December till the 15th of January.
 
TESKATLIPOKA:


Thanks. Noted. I'd like some specific advice, not a hint.


{
OrderSend (Symbol(),OP_BUYSTOP, lots, Ask+Point*order,3, Bid-sl*Point, Bid+tp*Point );// we send the order
ObjectDelete (buy_stop); // the line is deleted
}

//----
return(0);
}

I don't understand where you get the line from.

In general :

without any object in the if

but that's my opinion anyway. Check it out.

You can put all three through or || then it's more likely to work because the price jumps.

and you can also assign if the price is above the line then false, below the line then true or with 1 and 0

if(линия == Ask);
или 
if(линия == Bid);
или
if((линия < Ask) && (линия > Bid));
 
TESKATLIPOKA:


// find the line and place an order when the price touches
if (ObjectFind (buy_stop) > 0 ) // if there is a buy_stop line.

// it does, but the line should touch the price.


If levels are defined by horizontal lines:

if (ObjectFind (buy_stop) > 0 ) //если есть линия buy_stop. 
  if ( ObjectGet(buy_stop, OBJPROP_PRICE1) <= Ask )
  {
    // цена достигла либо миновала линию открытия

  }
 
belck:

I don't understand where you get the line from.

Actually:

without any object in the if

but that's my opinion anyway. Check it out.

You can put all three through or || then it's more likely to work as the price jumps.

you can also assign if the price is above the line then false, below the line then true or with 1 and 0.


Thank you. I'll try. I draw and name the lines myself
 
PapaYozh:

If the levels are defined by horizontal lines:


Thank you. I'll try it out.
Reason: