[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 354

 
Valsorya:

Good afternoon !!!

How do I know what to do - Alpari does not pass arrays of fractional numbers to the DLL in a normal way, I thought there was an error somewhere in the Expert Advisor! I copied all the files to insta,forexfo4Yu - everything is transferred correctly! I copied all files to insta, forexfor4U - everything is correct! Passing it directly into dll - sloppy! Works in insta,forex4yu! Not in alpari! This is just some kind of crap! I cannot make it work! I will have to do it tomorrow. I will have to twist tomorrow to transmit fractional numbers as integers, for example, multiply them all by 100,000 and divide them by 100,000 in dll and get fractions. But the size of the contract is 100,000... if you multiply it by 10,000, it won't fit into an integer.

Maybe someone knows how to do it, EA is writing.

Show me the code.
 
Please advise how to make baylimit open every 50 pips and if it does, it does not open any more.
 

How can I find out the amount of AccountEquity() at the start of the trading day?

 
Elektronik:

How can I find out the amount of AccountEquity() at the start of the trading day?


calculate it yourself.
or download an indicator from the codebase.

 

Advice on mql4 programming literature for beginners, if you can provide references

 

How to disable Alert, installed it and can't see it in the table, please advise

 
How do I check if there is a pending or open order for by at a given price?
 

I thought there was an error somewhere in the Expert Advisor! I copied all the files to insta,forexfo4yu - everything is transferred correctly! I copied all files to insta, forexfor4U - everything is correct! Passing it directly into dll - sloppy! Works in insta,forex4yu! Not in alpari! This is just some kind of crap! I cannot make it work! I will have to do it tomorrow. I will have to get rid of it tomorrow to transmit fractions as integers, for example, multiply them all by 100,000 and divide them by 100,000 in dll and get fractions. But the size of the contract is 100,000... if you multiply it by 10,000, it won't fit into an integer.

Maybe someone knows how to do it, I'm writing. Asked to put the code here :

in mql:

in the header:

//+------------------------------------------------------------------+
#import "file name will not tell))).dll"

void SendDataToDLL(int SendDataToDLL_DataForDLL_int[50],
double SendDataToDLL_DataForDLL_double[50],
int SendDataToDLL_ArrayOfErrors[30],
int SendDataToDLL_ArrayOfWornings[10]);
...

#import
//+------------------------------------------------------------------+
...
//+------------------------------------------------------------------+
int init()
{...
CreateDataForDLL();
SendDataToDLL(DataForDLL_int,
DataForDLL_double,
DataToDLL_ArrayOfErrors,
DataToDLL_ArrayOfWornings);
...
}
//+------------------------------------------------------------------+
void CreateDataForDLL()
{...
int CreateDataForDLL_i = -1;
...
CreateDataForDLL_i++; DataForDLL_double[CreateDataForDLL_i] = AccountLeverage();
CreateDataForDLL_i++; DataForDLL_double[CreateDataForDLL_i] = AccountStopoutLevel();
CreateDataForDLL_i++; DataForDLL_double[CreateDataForDLL_i] = AccountBalance();
CreateDataForDLL_i++; DataForDLL_double[CreateDataForDLL_i] = AccountCredit();
...
}

//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+

in C++

Declare in the header, of course, and write in cpp:

extern "C" __declspec(dllexport) void __stdcall SendDataToDLL(int SendDataToDLL_DataForDLL_int[50],
double SendDataToDLL_DataForDLL_double[50],
int SendDataToDLL_ArrayOfErrors[30],
int SendDataToDLL_ArrayOfWornings[10])
{...
int SendDataToDLL_i; SendDataToDLL_i = 0;
// unblock the int array without any problems
...
SendDataToDLL_i = 0;
... //InputData - structure... no big deal...
SendDataToDLL_i++; InputData.AccountLeverage = SendDataToDLL_DataForDLL_double[SendDataToDLL_i];
SendDataToDLL_i++; InputData.AccountStopLevel = SendDataToDLL_DataForDLL_double[SendDataToDLL_i];
SendDataToDLL_i++; InputData.AccountBalance = SendDataToDLL_DataForDLL_double[SendDataToDLL_i];
SendDataToDLL_i++; InputData.AccountCredit = SendDataToDLL_DataForDLL_double[SendDataToDLL_i];
...
string sssss;
sssss = GetCurrentDir().c_str();
sssss += "\\InputData.txt";
std::ofstream out2 (sssss.c_str());
// output an int array to the text file - everything is fine
...
for (SendDataToDLL_i = 0; SendDataToDLL_i < 40; SendDataToDLL_i++)
{out2 << FloatToStr(SendDataToDLL_DataForDLL_double[SendDataToDLL_i]).c_str() << '\n';
}
...}

//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+

We look into the text file and enjoy correct data in the int array, while the double array that follows is full of nonsense like zeros or crazy huge numbers that can't be there in principle.

If all these files (dll and ex4) are thrown into insta, for example, everything works fine and all the data is displayed correctly.
 
Stells:

Good afternoon.

Could you advise me on the best way to record the crossing of, say, stochastics:

on the first and third bar compare the values of the signal and main lines or the first and second ?


On the two adjacent ones.
 
And why does MarketInfo(Symbol(), MODE_STOPLEVEL) return 0 on alpari???