Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hey everyone, I'm a new member to this forum. I had a question regarding how to reference a historical bar in Easylanguage. I know you can use [1] to reference a previous bar, but I can't figure out how to return the close of a particular time. For example I want to setup a reversal play at the end of the day is price has moved more than a certain amount from another reference bar. This is what I've tried so far *inputs: starttime(1530), endtime(1555); variables: barcalc(0); barcalc=endtime-starttime; If Time = endtime and (close[barcalc] - close) 10 then buy next bar at market;* I think this should work on a 1 minute chart but TS gives me an error saying it cannot reference the number of bars. Any help would be appreciated.
Can you help answer these questions from other members on NexusFi?
You could try to store the close price on a specific time, like..
Variables:
storedClose(0);
// Store close of a specific time
if (Time = 1530) then
storedClose = Close;
// Compare it with the current close
if (Time = 1555) and ((Close - storedClose) >= 10) then
Buy next bar at market;
(Tip: use enters and the [ code ] and [ / code ] tags around your answer for easier reading/better understanding)
The simplest way to reference past bars is to create a counter, start at your specified time or condition, then use that counter to reference how many bars ago your condition occurred.
Here is a basic signal that uses a counter to reference a previous bar.
[ code ]
vars: count(0);
if barnumber>0 then begin
count = 0;
if time = 830 then begin
count = count[1] + 1;
end;
if time = 1430 then begin
if close > (close[count] +10 then
sell short next bar at market;
end;
[ / code ]
I have a similar albeit more complex problem. I need to determine trading session using hourly bars in Forex. Forex day in Sydney starts at 7:00 and ends at 6:59. I need to determine the the range of the previous day. HighD and HighD won't work because it starts a midnight.
Do I have to build the array of prices and then use high and low from it?
ABCTG
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629
ursus,
you could use two variables and track the high and low within certain times yourself. There are a few examples for that posted on nexusfi.com that should get you going.
This one for example:
Total EL newbie here and I'm trying to plot the high and low for a specific timeframe 8am - 9:30 for current day. This is what I have so far, but unable to get the EL code to plot for current day. This is what I have so far …
Regards,
ABCTG
ursus
I have a similar albeit more complex problem. I need to determine trading session using hourly bars in Forex. Forex day in Sydney starts at 7:00 and ends at 6:59. I need to determine the the range of the previous day. HighD and HighD won't work because it starts a midnight.
Do I have to build the array of prices and then use high and low from it?