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

 
sergeev:

//learn how to code


Continue to https://www.mql5.com/ru/forum/131277/page149

Thank you! I did that at first too... But maybe this function didn't respond to all types of crossovers!? Because as far as I understand in this case we are checking for truth on every bar, but not on the time segment! If there is a saw (see graph), the flag will change several times from 14/02 to 15/02. correct? Therefore, it is necessary to compare the flag on each bar of the time interval. Correspondingly, if all flags are true, then there was no trend change... How to implement this? HELP ME ! Thanks in advance !

 
todem:
what do you think of this advisor?

Is this RSI that good? if so...would you share...))
 
Could you please tell me how to execute a buy or sell condition in an EA with a custom indicator? For example, a custom indicator gives buy or sell arrows, iCustom(...0) and iCustom(...1) are, as I understand, buffer indices that contain sell and buy, but how to write a condition in an EA, please advise.
 
find the commented advisor and have a look:)
 


Please advise, I have added a stoploss line to the EA, but it still puts a takeprofit when it opens an order, but the stoploss is not there.

 

#property copyright ""
#property link ""

double TrailStart = 10.0;
double TrailStop = 10.0;

extern double LotExponent = 1.4; // by how much to multiply the lot when placing the next knee. example: first lot 0.1, series: 0.16, 0.26, 0.43 ...
extern bool DynamicPips = true;
extern int DefaultPips = 12;
extern int Glubina = 24;
extern int DEL = 3;
extern double slip = 3.0; // the price may differ in case a brokerage company requests requotes (at the last moment the price changes a little)
extern double Lots = 0.1; // lot size for the beginning of trading
extern int lotdecimal = 1; // how many decimal places in lot to count 0 - normal lots (1), 1 - mini lots (0.1), 2 - micro lots (0.01)
extern double TakeProfit = 10.0; // after reaching a profit, close the position
extern double Stoploss = 10.0; // breakeven level
//extern double PipStep = 30.0; // step between opening of new knees
extern double Drop = 500;
extern double RsiMinimum = 30.0; // lower bound of RSI
extern double RsiMaximum = 70.0; // RSI upper bound.
extern int MagicNumber = 2222; // magic number (helps EA distinguish its own bets from others)
int PipStep=0;

extern int MaxTrades = 10; // maximum number of orders opened simultaneously
extern bool UseEquityStop = FALSE;
extern double TotalEquityRisk = 20.0;
extern bool UseTrailingStop = FALSE;
extern bool UseTimeOut = FALSE; // use timeout (close trades if they "hang" too long)
extern double MaxTradeOpenHours = 48.0; // time ta

 
RoniIron:

Can you tell me please, I added a stoploss line to the EA, but it still puts a TP when it opens an order, but the stoploss does not.


extern double TakeProfit = 10.0; // after reaching a profit, close the order
extern double Stoploss = 10.0; // breakeven level

If I write the word "dick" on the wall, will it go up ?

Very rare people, with a certain gift can create objects or move them with their mind.

 
To put it another way - for stoploss to be placed, you need to write it in the EA to be placed, not just write stoploss in external parameters
 

Hi all.

Can you tell me if mql4 is able to set pending orders? I'm messing around with it but all price indication is different from market price and i got "new price" error.

OrderSend(Symbol(),OP_BUY,0.100,Ask,3,Bid-100*Point,Bid+100*Point,"Comment",77777,0,Green); 

I am experimenting with this line. I tried to change the Ask for something like 1.6213 and got an error 138.


Thank you in advance for pointing the way.

Reason: