[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 441

 
rigc:
I compile an indicator and it gives an error ')'. - unbalanced right parenthesis - what could be the reason?
the number of parenthesis "(" and parenthesis ")" are different
 
Roman.:


File writing error. Correct the code.

Thank you.
 
ilunga:
the number of brackets "(" and brackets ")" is different
thanks, fixed it!
 

Hi,

How should I make a moving average Expert Advisor open a position not when the chart has crossed the moving average, but when it has crossed the moving average + 10 pips higher. To discard false positives

Thank you

 
kostikk:

Hi,

How should I make a moving average Expert Advisor open a position not when the chart has crossed the moving average, but when it has crossed the moving average + 10 pips higher. To discard false positives

Thank you


You add a variable to the condition:

extern int point = 10;
 

----------------------------



if(Ask  > Ma0 +point*Point  && Ask  < Ma1+point*Point )//для Бая


--------------------------

if(Bid  < Ma0 -point*Point  && Bid > Ma1-point*Point )//для Сэлла 
 

Can you tell me how to update the offline chart correctly? You do not need to update the whole chart, but only the last bar.

For example, this is how the chart is updated when using the "HistoryBarsEditor" script https://www.mql5.com/ru/code/10488.

As far as I understand, after editing, the chart is updated due to these bars:

  int MT4InternalMsg = RegisterWindowMessageA("MetaTrader4_Internal_Message");
  PostMessageA(hChart,MT4InternalMsg, 2, 1);  //эмуляция тика
  
  UpdateWindow(hTerminal);

But when I insert the same lines into "synbar" indicator which I want to edit https://www.mql5.com/ru/articles/1353 instead of

PostMessageA(hwnd,WM_COMMAND,33324,0);
the update does not happen.
 
fenik:

Can you tell me how to update the offline chart correctly? When updating, you don't want the whole chart to be updated, but only the last bar.

Look at the PeriodConverter script in the terminal
 
sergeev:
see the PeriodConverter script supplied with the terminal


Unfortunately, it too is updated by PostMessageA(hwnd,WM_COMMAND,33324,0); the whole chart is redrawn with a tick.
 

but the chart can't draw only one bar (a slice of the screen) when updating.

it updates the whole window at once.

 
paladin80:
If no one answers, it means people don't know what to answer. You don't need to post so many times and copy so much text.
I can't believe it's such a difficult question that no one can answer!!!!! ... I post many times because the question often "slips through" because of other questions and answers to those other questions
Reason: