There is no need to use
MarketInfo(NULL,MODE_DIGITS)
(which returns a double) when getting digits for the chart symbol. Just use
Digits
Use the code button OR (Alt+S) when pasting code.
There is no need to use
(which returns a double) when getting digits for the chart symbol. Just use
Use the code button OR (Alt+S) when pasting code.
Thank you, very much.
//===============
May you aslo tell me what could be the issue,
on the same code i added
if(Bid<=(FiboD1) && N<NumberOfOrder) && RSI <= Buy_level)
if(Ask >=(FiboD1) && N<NumberOfOrder) && RSI >= Buy_level)
No error, but it is only opening Buy order. No Sell order
if(Bid<=(FiboD1) && N<NumberOfOrder) && RSI <= Buy_level)
if(Ask >=(FiboD1) && N<NumberOfOrder) && RSI >= Buy_level)
So you're saying that Buy_level is involved in your Sell decision?
So you're saying that Buy_level is involved in your Sell decision?
Thank you for pointing this out, i dont know how i missed it.
Good day All
May someone please assist me with this warning?
Check the forum but could not find anything that worked fixing this warning
Here is the code that is giving the warning
Sorry i do not have the SRC button to post the code correctly. Thank you
possible loss of data due to type conversion Dimba.mq4 699 85
possible loss of data due to type conversion Dimba.mq4 699 154
possible loss of data due to type conversion Dimba.mq4 699 223
Change this Line MarketInfo(NULL,MODE_DIGITS))
int(MarketInfo(NULL,MODE_DIGITS))
void OpenPending() { int Ticket1=0, Ticket2=0; RefreshRates(); { if(Bid<=(FiboD1) && N<NumberOfOrder) { Ticket1 = OrderSend(Symbol(),OP_BUYSTOP,LotCalculated(),NormalizeDouble(FiboD1, int(MarketInfo(NULL,MODE_DIGITS))),3, NormalizeDouble(FiboD1-StopLoss*pips, int(MarketInfo(NULL,MODE_DIGITS))), NormalizeDouble(FiboD1+TakeProfit*pips, int(MarketInfo(NULL,MODE_DIGITS))), ORDERS_COMMENT,MagicNumberS1,0,clrBlue); Ticket2 = OrderSend(Symbol(),OP_BUYSTOP,LotCalculated(),NormalizeDouble(FiboD1, int(MarketInfo(NULL,MODE_DIGITS))),3, NormalizeDouble(FiboD1-StopLoss*pips, int(MarketInfo(NULL,MODE_DIGITS))), NormalizeDouble(FiboD1+TakeProfit*pips+StopLoss*pips, int(MarketInfo(NULL,MODE_DIGITS))),ORDERS_COMMENT,MagicNumberS1,0,clrBlue); N=N+1; } }
Thank you for pointing this out, i dont know how i missed it.
Be careful with NULL.
- On MT4, you can use NULL in place of _Symbol only in those calls that the documentation specially says you can. iHigh does, iCustom does, MarketInfo does not, OrderSend does not.
- Don't use NULL (except for pointers where you explicitly check for it.) Use _Symbol and _Period, that is minimalist as possible and more efficient.
- Zero is the same as PERIOD_CURRENT which means _Period. Don't hard code numbers.
- MT4: No need for a function call with iHigh(NULL,0,s) just use the predefined arrays, i.e. High[].
- Cloud Protector Bug? - MQL4 programming forum 2020.07.25
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Good day All
May someone please assist me with this warning?
Check the forum but could not find anything that worked fixing this warning
Here is the code that is giving the warning
Sorry i do not have the SRC button to post the code correctly. Thank you
possible loss of data due to type conversion Dimba.mq4 699 85
possible loss of data due to type conversion Dimba.mq4 699 154
possible loss of data due to type conversion Dimba.mq4 699 223