[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 905

 
Vinin:


Put it in include

connect

#include <VinL_Trade_V3.mq4>

Great. Thank you. And if you can do it properly.

I put this include <VinL_Trade_V3.mq4> into my Expert Advisor.

What is the correct way to call them from the Expert Advisor?

 
belck:

super. thank you. and if you can, how to work with them correctly.

I put this include <VinL_Trade_V3.mq4> in my EA.

What is the correct way to call them from the EA?


Inside the library, everything is there. With a minimum level, you can already use it.
 
Vinin:


Put in include

connect

#include <VinL_Trade_V3.mq4>

like this, right?

#property copyright "Copyright © 2010, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
#include <VininL_Trade_V3.mq4>
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
 
Vinin:

Everything is inside the library. With a minimum level you can already use it.

Literally a couple of examples, please.

 
Vinin:

The library has everything inside. You can already use it with a minimum level.

I've had one person do it for me. but I honestly can't figure out how it calls from another file. i honestly don't understand.

I am attaching the library with the Expert Advisor, maybe someone will need it.

Files:
 
Vinin:

Everything inside the library is there. At the lowest level, you can already use it.

I started to try it and this is the result:

if (FirstIndikcheckBuy && SecondIndikcheckBuy && ThirdIndikcheckBuy && FourthIndikcheckBuy){
 lib.Order_Open(OP_BUY, Magic);
 }

It gives an error:

')' - wrong parameters count    C:\Program Files\Терминал тест\experts\Пробный 1.mq4 (81, 30)
 
I am a beginner. Has anyone ever created an indicator to show volatility, trend direction and spreads for selected instruments? I would like to make such a table in real time.
 
pay:
I am a beginner. Has anyone ever thought of making an indicator to show volatility, trend direction and spreads for selected instruments?

check out this option.

https://www.mql5.com/ru/code/10289

 
Do you know how to make an EA check the transaction history to see if

has closed some of the last executed orders, on tp or sl,

for example the last 3 executed orders were closed on tp or one of them was closed on sl?

Thank you.
 

Sorry, me again, same old story. My little brother came over, played Battleship, while I took my mind off the computer, walked around, had some tea and cake, watched the adventures of Riddick.

//+------------------------------------------------------------------+
//| Dimon's Borders .mq4 |
//| Copyright © 2010, MetaQuotes Software Corp.
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| expert initialisation function |
//+------------------------------------------------------------------+
extern int BandsPeriod=20,i=1 ;extern int BandsShift=0;
extern double BandsDeviations=2.0;
extern double Lots=0.1,TakeProfit=50,stoploss=10;
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{ int total=OrdersTotal(); Comment(" total ",total); Alert (" total ",total);
if ( total !=0 ){return;}

double Average,Verhnyayaghranytsa,Nyzhnyayaghranytsa,newres,sum,deviation;
string text; int ticket; int err;
text="macd sample";
Average=iMA(NULL,0,BandsPeriod,BandsShift,MODE_SMA,PRICE_CLOSE,i);
//----
newres=Close[i]-Average;
sum=newres*newres;


deviation=BandsDeviations*MathSqrt(sum/BandsPeriod);
Verhnyayaghranytsa=Average+deviation;
Nyzhnyayaghranytsa=Average-deviation;
//----
if (Verhnyayaghranytsa<Close[i])
{ //Comment("buoy!",Verhnyayaghranytsa );
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-stoploss*Point,Ask+TakeProfit*Point, "macd sample",16384,0,Green);

}


if (Nyzhnyayaghranytsa>Close[i])
{ //Comment(" sell! ",Nyzhnyayaghranytsa );

ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+stoploss*Point,Bid-TakeProfit*Point, "macd sample",16384,0,Red);
// Alert (GetLastError();

}
return(0);
}
//+------------------------------------------------------------------+
Same error again 130!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

And it's easier to think when you're out and about.

Reason: