Please, need help to correct my code (the global form and synthax)

 

I am a begineer in MQL, I have test my code on the tester but I dont have any result (0000 at all fields)

Here is my code, please help me.

//+------------------------------------------------------------------+
//| ST_V001.mq4 |
//| SC |
//| https://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "SC"
#property link "https://www.metaquotes.net/"

double ref_L=1.35;
double Tpp = 0.0100;
int n,Tik;
double i[],j[],Num[],r[];
double L[];
double S[];

extern double volume;
extern double price;
int slippage;
extern double stoploss;
extern double takeprofit;
string comment;
int magic;
datetime expiration;
datetime closeTM;

//------------------------------------------------------------------
// expert initialization function
//------------------------------------------------------------------
int init()
{
volume=0.1;
price=L[n];
slippage=5;
stoploss=(L[n]-Tpp*2);
takeprofit=L[n]+200;
comment=NULL;
magic=0;
expiration=0;

for(n=1; n<3; n++)
{
L[n] = ref_L + (n-1)*Tpp; i[n]=-1; j[n]=0; r[n]=1; S[n]=L[n]+Tpp;
}
return(0);
}
//------------------------------------------------------------------
// expert deinitialization function
//------------------------------------------------------------------
int deinit()
{
return(0);
}
//------------------------------------------------------------------
// expert start function
//------------------------------------------------------------------
int start()
{
// Long + Init -------------------------------------------------------
for (n=1; n<3; n++)
{
if (((iClose(Symbol(), PERIOD_M1, 1) < L[n]) && (iClose(Symbol(), PERIOD_M1, 2) >= L[n])) && ((i[n]==-1) || (i[n]==0)))
{
Tik=OrderSend(Symbol(),OP_BUYSTOP,volume,price, slippage, stoploss, takeprofit, comment, magic, expiration,Green); // a buy stop ordre
Num[n]=Tik;
i[n]=1;
}
// Short -------------------------------------------------------
if (i[n]==1)
{
if (iClose(Symbol(), PERIOD_M1, 1) < L[n]+Tpp)
{
S[n]=L[n];
r[n]=r[n]+1; j[n]=1;
stoploss=S[n];
OrderModify(Num[n], OrderOpenPrice(), stoploss, takeprofit, expiration, Blue); // to modefy the stop
}
if (OrderSelect(Num[n], SELECT_BY_TICKET)==true)
{
closeTM=OrderCloseTime(); // to veriify if the ordre Num[n] is close or no
if(closeTM !=0)
{
i[n]=0; j[n]=0; r[n]=1;
}
}
}
}
return(0);
}
//------------------------------------------------------------------

Files:
 

Use the Print statement to find out if the values are being populated properly, for eg:


Print("n=",n," L[n]=",L[n]);


Then from the Experts tab of the Terminal window, you can see what's happening, or not happening.

 
Much easy to say where is your code is proper, less then 20%, the rest is wrong. Read the book MQL4.