EA custom indicator problem beginner - page 2

 
Close[0] < band_middle_curr


Did you try Close[1] > band_middle_curr ?
 
mt4ski:
Did you try Close[1] > band_middle_curr ?
Hi! yes i did... but again... i get buy signal above upper line, and it should be below...
Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Indicators Lines
Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Indicators Lines
  • www.mql5.com
Indicators Lines - Indicator Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Josip Marić:
Hi! yes i did... but again... i get buy signal above upper line, and it should be below...

Check your values against the chart you are looking at to see if they match.

PrintFormat("last close (%d) > middle band (%d) && last close < upper band (%d)",Close[1],band_middle_prev,Close[1], band_up_prev);
 
mt4ski:

Check your values against the chart you are looking at to see if they match.

Thank you very much this is very helpful!... i just did and i can see that all of the values are wrong... but when i comment values on the chart, they are all correct... i really dont't get it now...i have to figure out why this is happening.... if you have any idea, please let me know...
 
Josip Marić:
Thank you very much this is very helpful!... i just did and i can see that all of the values are wrong... but when i comment values on the chart, they are all correct... i really dont't get it now...i have to figure out why this is happening.... if you have any idea, please let me know...

Do you have the right period and symbol?

Print(Symbol(),"; ",Period()," minutes");
 
mt4ski:

Do you have the right period and symbol?

Symbol and Period are correct BTC/USD 1440minutes


these are my values... they are all wrong... some of the values are negative...

2021.02.20 18:58:41.462 2021.02.17 23:59:59   BTCUSD,Daily: last close (-515396076) > middle band (440509579) && last close(-515396076) < upper band (-1203849329)
 
Josip Marić:

Symbol and Period are correct BTC/USD 1440minutes


these are my values... they are all wrong... some of the values are negative...

It's weird. Try this:

double last_close = iClose(_Symbol,PERIOD_CURRENT,1);
Print(last_close);
 
mt4ski:

Try this:

This displays correct previous price close number, but my indi band numbers are still wrong...
 
Josip Marić:
This displays correct previous price close number, but my indi band numbers are still wrong...
This line is suspicious.
input maTypes            PriceFilterMode = ma_smoo;
 
mt4ski:
This line is suspicious.

I have deleted it and compiled the code, but i get same results again...

2021.02.20 22:25:58.304 2021.02.17 23:59:59BTCUSD,Daily: last close (-343597384) > middle band (-133712274) && last close( ) < upper band (-343597384)
Reason: