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

 
MosheDayan:

Friends, I need some advice...pls.

I am drawing a line from the last bar to the "white" level I want. The "white" level is placed from the beginning of a trading session(00:01) to its close (23:59). How can I force this line not to draw straight down, but to the end of the day (23:59), i.e. to the end of the line "white"? Is there any way to fixBuffer1[1]... or am I messing with the buffers for nothing...

Thanks.


For DRAW_LINE you need price values on every bar. Use a different line drawing type - you'll find the right one for you I think. Just put cursor on DRAW_LINE and press F1.

 
buyanov:


message before the start of the segment

"somma echrested"

what does it mean?

what to do?


This could be the problem.

 Alert(Delta,Digits()));
 
buyanov:


message before the start of the segment

"somma echrested"

what does it mean?

what to do?


This could be the problem.

 Alert(Delta,Digits()));
 
buyanov:


Maybe that's the problem.


No, unfortunately. I've got the text fragment wrong. It should be like this

//---------------------------------------------------------------------------------------------------------------------------

void OnTick()

{

//*********************************

Alert("beg OnTick");

FastMA=NormalizeDouble(iMA(NULL,0,Period_FastMA,0,MODE_SMA,PRICE_CLOSE,1),Digits());//Period_FastMA=4

SlowMA=NormalizeDouble(iMA(NULL,0,Period_SlowMA,0,MODE_SMA,PRICE_CLOSE,1),Digits());//Period_SlowMA=8

GetNext(NextTick);

Alert(NextTick);

Alert("NextTick=",NextTick);

Delta=NormalizeDouble(FastMA-SlowMA,Digits());

Alert(Delta,Digits());

Alert("FastMA=",DoubleToStr(FastMA)),Digits(), "SlowMA=",DoubleToStr(SlowMA,Digits()), "Delta=",DoubleToStr(Delta,Digits());


//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


//-----------------------------------------------------------------------------------------------------------------------

Alert("end OnTick()");

}


 
buyanov:

No, I'm sorry. I've misspelled a section of text. It should be like this




Correct the mistake on this line.

Alert("FastMA=",DoubleToStr(FastMA)),Digits(),"SlowMA=",DoubleToStr(SlowMA,Digits()),"Delta=",DoubleToStr(Delta,Digits());

Use the SRC button to insert the code

 
STARIJ:
The message contains line numbers and positions where the compiler thinks a comma should be put. Most likely the line above

simpler - the bracket is unclosed... :-)

 

The terminal has a right-click function called "Refresh". It updates the data on the chart.

How can I perform a similar action from within the EA?

 
Dmitriy Voevodkin:

The terminal has a right-click function called "Refresh". It updates the data on the chart.

How can you perform a similar action from within an EA?


ChartRedraw() try. But this is not a full analogue.

 
Dmitriy Voevodkin:

The terminal has a right-click function called "Refresh". It updates the data on the chart.

How can you perform a similar action from within the EA?

What do you want to update from the EA?

 
Dmitriy Voevodkin:

The terminal has a right-click function called "Refresh". It updates the data on the chart.

How can I perform a similar action from within an EA?

The closest analogue is ChartRedraw - it redraws the chart.

But what else happens when "Refresh", this is unknown. Surely the RefreshRates and data window is rather refreshed and WatchList too. That is, there are obviously many actions there.

Reason: