Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 345

 
Сергей:

I understand you perfectly, but you're wrong.

Put in inverted commas and you get:

'EURUSD' - name expected MyIndi 3 (MA).mq4 61 14

Right

And where are the quotes here?

EURUSD'

 
Artyom Trishkin:

Where are the inverted commas?


The quotes in my code are double, in the error I get single quotes, I can't do anything about it.

I have no problem with outputting data to the window. The problem is with wrong output. Instead of "flat" it says "Attenthion!" and vice versa. The algorithm is elementary, I'm not sure where I screwed up...

I have no problems with compilation either. Post with code #3437.

 

The indicator itselfhttps://cloud.mail.ru/public/6Ney/gTq1xMcMd

I raised the issue of JPY charts changing results here

The indicator in question is herehttps://cloud.mail.ru/public/CAXu/p3uD3UzBJ . I didn't get any help with my question then, can you help me now?
 
Сергей:

I have double quotes in my code, but in the error I get single quotes, and I can't do anything about it.

I have no problem with outputting data to the window. The problem is with the wrong results. Instead of "flat" it says "Attenthion!" and vice versa. The algorithm is elementary, I'm not sure where I screwed up...

I have no problems with compilation either. Post with code #3437.

To keep people guessing, and to be able to properly understand what you're talking about, there are all the features for that in the post editor you enter:

you can attach the code as a file (there's +Add file at the bottom),

you can output the code as a code,

for example:

//+------------------------------------------------------------------+
//| Выводит в журнал список свечей серии                             |
//+------------------------------------------------------------------+
void CSeriesCollection::PrintListCandlesSeries(const uint num_candle)
  {
   int total=m_series.Total();
   ::Print("====== "+TextByLanguage("Список свечей тайм-серии","List of time series candles")+" ======");
   for(int i=0; i<total; i++){
      CCandleObject* candle=m_series.At(i);
      if(candle!=NULL){
         datetime time=candle.Time();
         if(time<TimeCurrent()-PeriodSeconds()*num_candle) continue;
         string tm=TimeToString(candle.Time());
         this.PrintCandle(candle);
         }
      }
   ::Print("====== "+TextByLanguage("Список свечей тайм-серии","List of time series candles")+" ======");
  }
//+------------------------------------------------------------------+

you can also display the log line as a code (you can copy it from the terminal log and paste it here as a code (SRC button))

2017.10.20 04:04:09.014 Свеча NZDUSD 2017.10.20 00:00, open: 0.70296, high: 0.70360, low: 0.70260, close: 0.70355, vol tick: 87, размер: 100, тело: 59, верх. тень: 5, нижн. тень: 36, тип: Бычья

then people won't have a misunderstanding of what you're talking about.

And sending people to third-party resource to download not-know-what from it - is not very friendly, right?

 
Сергей:
...

No problem with compilation either. Post with code #3437.

Well, you can click on #3437, select "Copy link" and paste the link into your post (also in the post editor) - so that people don't have to browse where they don't really need to ;)

 
Artyom Trishkin:

And referring people to a third-party resource to download whatever it is from there is not very friendly, is it?


Forgive my illiteracy.


MyIndi 1 MultiValue on MultiTimeFrames. At the bottom it shows the number of buy points.

MyIndi 2 Same as the first, but removed unnecessary data. Added data at the bottom - this is the average price change per minute for the different timeframes.

MyIndi 3 is Multi currency. It is based on a single MA with a shift. When the difference in the MA is reached, it shows "Warning!


All three work incorrectly when attached to charts with JPY (for some reason). MyIndi 3 does not work correctly at all, although the code is very simple.

And of course in all of them I can't find what's wrong, as I'm new to this... If anyone has time to figure it out and help, I would be very grateful.
Files:
MyIndi.mq4  54 kb
MyIndi_2.mq4  38 kb
 
Сергей:

Forgive my illiteracy.


MyIndi 1 Multi currency on MultiTimeFrames. At the bottom it shows the number of buy points.

MyIndi 2 Same as the first one, but removed unnecessary data. Added data at the bottom - this is the average price change per minute for the different timeframes.

MyIndi 3 is Multi currency. It is based on a single MA with a shift. When the difference in the MA is reached, it shows "Warning!


All three work incorrectly when attached to charts with JPY (for some reason). MyIndi 3 doesn't work correctly at all, although the code is very simple.

And of course I can't find the error in all of them as I am a novice in this matter. If anyone has time to understand and help, I will be very grateful.

Look at"Point", the JPY is different. Use MarketInfo. For example double EUR_point=MarketInfo("EURUSD",MODE_POINT);

 
Nauris Zukas:

Have a look at "Point", JPY is different. Use MarketInfo. For example double EUR_point=MarketInfo("EURUSD",MODE_POINT);

Thank you, I will try it out! I had an idea that was the problem, but didn't know HOW.


It worked! Thank you very much, kind man! =)

I added in the beginning

      double USD_point=MarketInfo("EURUSD",MODE_POINT);
      double JPY_point=MarketInfo("USDJPY",MODE_POINT); 

and according to what pair I process (with or without JPY) used one or the other variable.

 
Nauris Zukas:

Look at Point, the JPY is different. Use MarketInfo. For example double EUR_point=MarketInfo("EURUSD",MODE_POINT);

It's better to go straight away.

Point
SymbolInfoDouble(Symbol(),SYMBOL_POINT)
 
Vitaly Muzichenko:

Better at once.


I think the variant proposed by@Nauris Zukas will suit for multicurrency.

And your variant is better for single currency because it takes data from the chart to which it is attached.