+1 888 340 6572 



Post new topic Reply to topic 
How can I get the high and low of the previous day session   [ ]
Author Message
#1 posted 18 Mar 2012 

Status: Offline
Posts: 1064
Thanks Received: 196 times
Thanks Given: 613 times
Joined: 23 Nov 2010
Bonjour à tous
Hello to all

Did post a similar post, but not resolved yet
memberlist.php?mode=viewprofile&u=11966

My day start @ 5pm and closed the following day @ 4:59:59. I'm looking to get the high and low for this period.

Highd: Does get the highest price of the last calendar day
DailyHigh witch is suppose to return the high of the last day session is not working

Any help appreciate

Martin


#2 posted 18 Mar 2012 
User avatar

Status: Offline
Posts: 5181
Thanks Received: 1425 times
Thanks Given: 856 times
Joined: 29 Aug 2006
arjfca wrote:
Bonjour à tous
Hello to all

Did post a similar post, but not resolved yet
memberlist.php?mode=viewprofile&u=11966

My day start @ 5pm and closed the following day @ 4:59:59. I'm looking to get the high and low for this period.

Highd: Does get the highest price of the last calendar day
DailyHigh witch is suppose to return the high of the last day session is not working

Any help appreciate

Martin


Set your chart to exchange time, so that the begin and end time of the session are on the same day.



For this message the author TJ has received thanks:
arjfca


#3 posted 18 Mar 2012 

Status: Offline
Posts: 1064
Thanks Received: 196 times
Thanks Given: 613 times
Joined: 23 Nov 2010
[quote]

Set your chart to exchange time, so that the begin and end time of the session are on the same day.[quote]

That could be a solution, but not the one that I want to use.

My view: Forex market do close @ 4:59:59 New-York time so trend and market participants do look at the high and low of the previous session. Maybe same reaction could be seen for session starting @00:00:00 and close at 23:59:59. I did not test it

Any one interested to see what is a short term effect on price when the high or the low of the previous day session is crossed, see this video from my mentor

http://www.youtube.com/watch?v=RgOofu7A ... 26lrLwLF8=

I will work on a function to get the high and low of the previous day session value and publish the code later.

Happy trading week to all

Martin


#4 posted 18 Mar 2012 
User avatar

Status: Offline
Posts: 5181
Thanks Received: 1425 times
Thanks Given: 856 times
Joined: 29 Aug 2006
arjfca wrote:
Bonjour à tous
Hello to all

Did post a similar post, but not resolved yet
memberlist.php?mode=viewprofile&u=11966

My day start @ 5pm and closed the following day @ 4:59:59. I'm looking to get the high and low for this period.

Highd: Does get the highest price of the last calendar day
DailyHigh witch is suppose to return the high of the last day session is not working

Any help appreciate

Martin


I don't understand why you need to ask...

are you running a 24 hr chart?
what instrument you are tracking?
where is the exchange?
what is the chart resolution?


Code:
var:
day.high(0),
day.low(0);

if t = 1700 then
begin
     day.high = high;
     day.low = low;
end
else
begin

     if day.high < high then
     day.high = high;

     if day.low > low then
     day.low = low;

end;


#5 posted 18 Mar 2012 

Status: Offline
Posts: 1064
Thanks Received: 196 times
Thanks Given: 613 times
Joined: 23 Nov 2010
Hello TJ

24Hr chart start end end with New-York time session
Exchange is in New-York
Instrument: Eur.Usd
Scale, chart resolution: 175 sec.

Just came back from a walk with the dog and I was thinking of a similar solution as yours. Will nee to add a condition that will switch from > 1700 to < 1700 after midnight

Martin


#6 posted 18 Mar 2012 

Status: Offline
Posts: 1064
Thanks Received: 196 times
Thanks Given: 613 times
Joined: 23 Nov 2010
Here is my solution
1' count the number of bars that compose the day

When done, then each time a day finished, look for the lowest and the highest price for the last number of bars that compose the day

Et voilà!

Martin
Code:
// return the high and low of the previous  session  day

Var:
Intrabarpersist  Barcount (0),
Intrabarpersist CountStart (false),
intrabarpersist Counting (true),
Intrabarpersist BarNum (0),
Intrabarpersist Dayhigh (0),
Intrabarpersist Daylow (0);

// count the numbers of bars during a day
If counting = true then begin
   if time = 1700 and countstart = false then begin
      Barcount = 0;
       countstart = True;
       BarNum = Barnumber;
   end;
   
   If countstart = True and barnum <> Barnumber then begin
      Barcount = barcount +1;
      BarNum = Barnumber;
      If time = 1700 then begin
         Counting = false;
        Print (Barcount:0:0);
      end;
   end;
end;

//counting as been done and I know how many bars compose my day
// Now, found the highest and the lowest price for the previous barcount bars.
// This operation is done only when the day as been terminated

If counting = false and time = 1700 then begin
   Dayhigh = highest(high,Barcount);
   DayLow = lowest(low, barcount);
   Print ( dayhigh:5:5, "  " , daylow:5:5);
end;



Post new topic Reply to topic