Urgent Help needed from experienced EA Coders

 

Please help advise how I can save some price values of a bar or an identified range.

E.g lets assume my choice bar is 10.00GMT H1-bar, and I wish to save the vales of High and Low at 11.01, and I will like to use

these values throughout that day for decisions in my EA.

Or I probably I wish to pick the Range High/Low of 3 or more bars at a specific time for decisions throughout the day in my EA.

please kindly help asap.

 
fxtutor444:


Or I probably I wish to pick the Range High/Low of 3 or more bars at a specific time for decisions throughout the day in my EA.


Define your variable(s), use iHigh https://docs.mql4.com/series/iHigh to get the High value of a specific bar and iLow https://docs.mql4.com/series/iLow to get the low of a specific bar, store the values in the variables you have already defined.

If you want to use a specific time you can convert time to a Bar Shift value and use that Barshift value in iHigh and iLow, e.g.

datetime some_time=D'2004.03.21 12:00';
  int      shift=iBarShift("EUROUSD",PERIOD_M1,some_time);
  Print("shift of bar with open time ",TimeToStr(some_time)," is ",shift);

. . taken from here: https://docs.mql4.com/series/iBarShift

Does that help enough ?

 
RaptorUK:

Define your variable(s), use iHigh https://docs.mql4.com/series/iHigh to get the High value of a specific bar and iLow https://docs.mql4.com/series/iLow to get the low of a specific bar, store the values in the variables you have already defined.

If you want to use a specific time you can convert time to a Bar Shift value and use that Barshift value in iHigh and iLow, e.g.

. . taken from here: https://docs.mql4.com/series/iBarShift

Does that help enough ?

Thanks very much, however this may not help, maybe a clearer description will be needed

//

if I use this two issues will arise; (1) Either, I will need to be filling my choice Bar Time manually

(2) OR, values will be changing with every new bar

//

What I actually need is How I can Save the values after identifying it with iHigh iLow iHighest and iLowest, such that when the shift of that bar/Range

changes the values will still be accessible for my decisions throuout the day.

E.g At 9.00GMT the Higest of last three bars is 1.43898 and the Lowest is 1.42678,

at this point it is easy to find this values with Bar_1, Bar_2 and Barar_3, but by 13.00GMT those bars would have change to bar_4,bar_5 and bar_6

hence their values will change to last three bars value.

So what I need is how to store those values at 11.00GNT and use it throughout the day.

Thanks once again.


 
fxtutor444:


So what I need is how to store those values at 11.00GNT and use it throughout the day.

Thanks once again.

Define variables and use them to store the values, e.g.

double MorningHigh, MorningLow;


MorningHigh = iHigh(Null, 0 ,iHighest( Null, 0, MODE_HIGH, 3, 0))); 
MorningLow  = iLow(Null, 0 ,iLowest( Null, 0, MODE_HIGH, 3, 0)));

if you want to keep those values stored even if you stop and start your EA/MT4 then you can use Global variables : https://docs.mql4.com/globals

 
RaptorUK:

Define variables and use them to store the values, e.g.

if you want to keep those values stored even if you stop and start your EA/MT4 then you can use Global variables : https://docs.mql4.com/globals


May be this will help, but I do not know how to save it in Global variables.

please explain this step by step.

Thanks very much

 
fxtutor444:

May be this will help, but I do not know how to save it in Global variables.

please explain this step by step.

Thanks very much

If you are going to code you have to learn, read this, try it . . . https://docs.mql4.com/globals
 
  1. Why do you need to save them? Just compute them again. Find the bars you want with iBarShift or loop back and find the TimeHour() you want.
  2. E.g lets assume my choice

    Or I probably I wish to pick the

    STOP. Think your problem out clearly and state an EXACT requirement. "I want A or B or last years or someother thing" is useless.
  3. No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you. Where is YOUR code?
Reason: