MQL4 Function is not executing

I am a new bee Please help me on this issue… CreateOrder() is not beeing executed.

Code: Sample code..

double currentPBid = Bid;

double currentPAsk = Ask;

int GridMargin = 25*Point*10;

int totalorders = 5;

int OnInit()

{

CreateOrders();

return(INIT_SUCCEEDED);

}

int n = 2;

int i;

void CreateOrders()

{

for( i = 0 ; i == totalorders ; i ++)

{

OrderSend(Symbol(),OP_BUYLIMIT,0.01,currentPBid + GridMargin, 1 , 0 , currentPBid + n*GridMargin);

OrderSend(Symbol(),OP_SELLLIMIT,0.01,currentPAsk + GridMargin, 1 , 0 , currentPAsk + n*GridMargin);

n++;

}

Submitted November 10, 2020 at 01:25AM by AjayBhas
via https://ift.tt/38tX09S

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s