problem with setting price offset

 

this won't work:

void BuyPendingOrderFlex58()
{
int expire = TimeCurrent() + 60 * 450;
double price = NormalizeDouble(iCustom(NULL, NULL, "Pivots",0,0), NDigits) + PriceOffset58*PipValue*Point;
double SL = NormalizeDouble(iCustom(NULL, NULL, "Pivots",0,0, NDigits) + PriceOffset60*PipValue*Point;
if (iCustom(NULL, NULL, "Pivots",0,0) == 0) SL = 0;
double TP = NormalizeDouble(iCustom(NULL, NULL, "Pivots",2,0), NDigits);
if (iCustom(NULL, NULL, "Pivots",2,0) == 0) TP = 0;
if (450 == 0) expire = 0;
int ticket = OrderSend(Symbol(), OP_BUYLIMIT, BuyLots58, price, 4, SL, TP, "My Expert", 1, expire, Blue);
if (ticket == -1)
{
Print("OrderSend() error - ", ErrorDescription(GetLastError()));
}
AtCertainTime124();

}

priceoffset58 is 3, and priceoffset60 is -10.

i tried to comment out only these buylimits (there are 6 more) and editor doesn't report any error in that case. what is wrong here (because editor reports " ';'-unexpected token" error and many other errors, but only in buylimit orders)?

in the attachment i put the whole ea in mq4


please help guys, this is killing me....

Files:
 

Please use this to post code . . . it makes it easier to read.

You have a missing ) . . .

double SL = NormalizeDouble ( iCustom ( NULL, NULL, "Pivots",0,0 )  , NDigits) + PriceOffset60*PipValue*Point;

. . . . in several similar places

 
RaptorUK:

Please use this to post code . . . it makes it easier to read.


just did, tnx :)
 
RaptorUK:

Please use this to post code . . . it makes it easier to read.

You have a missing ) . . .

. . . . in several similar places

Fix them and your code compiles . . .

Do you know what the value of NULL is ?

 

It may well work using NULL but iCustom calls for you to use 0 for the current timeframe . . .

https://docs.mql4.com/indicators/iCustom

 

this is what happens when one's code is saved at few places at the same time :) stupid mistakes (because I corrected this copy/paste missing bracket already before)... :)

tnx raptorUK

Reason: