Gamestudio Links
Zorro Links
Newest Posts
Can't plot daily high & low
by Zheka. 10/14/19 18:39
TWS "Market closed" fix
by jcl. 10/14/19 15:09
2xCapital slider to increase size
by jcl. 10/14/19 14:03
Imgui Lite-c Development
by txesmi. 10/13/19 09:40
A9
by Dooley. 10/11/19 18:53
Need Help Finding Cause of Crash
by Dooley. 10/11/19 18:51
What algorithm is used for BALANCED?
by JamesHH. 10/11/19 17:32
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
7 registered members (exile, Dooley, Dalla, kvm, sdh309795gaas, jibanes, Zheka), 661 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
FrankW, TedMar, raimucuk, vivaldi2, filip
18304 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Can't plot daily high & low #478375
10/09/19 17:35
10/09/19 17:35
Joined: Oct 2019
Posts: 3
V
vivaldi2 Offline OP
Guest
vivaldi2  Offline OP
Guest
V

Joined: Oct 2019
Posts: 3
I am trying to plot yesterday high and low, but it return something different :
Code
function run()
{
	
	BarPeriod = 30;
	LookBack  = 0;
	
	
	asset("EUR/USD");
	

	
var session_high = dayHigh(UTC,1); //
var session_low = dayLow(UTC,1); // 
var session_pivot1 = dayPivot(UTC,1); // 


plot("USUTC-1 Session High Price", session_high, MAIN, GREEN); 
plot("USUTC-2 Session Low Price", session_low, MAIN, GREEN); 
plot("USUTC-3 Session Pivot", session_pivot1, MAIN, YELLOW); 

}

what is wrong with my code ?

Re: Can't plot daily high & low [Re: vivaldi2] #478379
10/10/19 08:56
10/10/19 08:56
Joined: Sep 2003
Posts: 861
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 861
Code looks ok, what is wrong with the plot?

Re: Can't plot daily high & low [Re: vivaldi2] #478381
10/10/19 13:49
10/10/19 13:49
Joined: Oct 2019
Posts: 3
V
vivaldi2 Offline OP
Guest
vivaldi2  Offline OP
Guest
V

Joined: Oct 2019
Posts: 3
Look at the screenshot, the high and low of yesterday ( green lines ) is not true .

Attached Files
Re: Can't plot daily high & low [Re: vivaldi2] #478384
10/11/19 11:04
10/11/19 11:04
Joined: Sep 2003
Posts: 861
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 861
Why is it not true?

Re: Can't plot daily high & low [Re: vivaldi2] #478398
10/13/19 16:16
10/13/19 16:16
Joined: Oct 2019
Posts: 2
toronto
J
Junker Online
Guest
Junker  Online
Guest
J

Joined: Oct 2019
Posts: 2
toronto
I agree with @vivaldi2. i am learning this now and i used the same formula but applied to 1 minute and in ET timezone.
my understanding of dayLow is that it gets the yesterday's lowest price of the day and dayHigh gets the yesterdays highest price for the day.

The day high seems to be working properly. but the day low is not.

[Linked Image]

formula i used is as below
Code
function run()
{
	
	BarPeriod = 1;
	LookBack  = 0;
	
	
	asset("EUR/USD");
	

	
var session_high = dayHigh(ET,1); //
var session_low = dayLow(ET,1); // 
var session_pivot1 = dayPivot(ET,1); // 


plot("USUTC-1 Session High Price", session_high, MAIN, GREEN); 
plot("USUTC-2 Session Low Price", session_low, MAIN, GREEN); 
plot("USUTC-3 Session Pivot", session_pivot1, MAIN, YELLOW); 

}

Re: Can't plot daily high & low [Re: vivaldi2] #478399
10/13/19 20:04
10/13/19 20:04
Joined: Feb 2017
Posts: 769
Chicago
AndrewAMD Online
User
AndrewAMD  Online
User

Joined: Feb 2017
Posts: 769
Chicago
Why did you set your lookback to 0 when your indicator is looking back?

Re: Can't plot daily high & low [Re: vivaldi2] #478400
10/13/19 23:51
10/13/19 23:51
Joined: Oct 2019
Posts: 2
toronto
J
Junker Online
Guest
Junker  Online
Guest
J

Joined: Oct 2019
Posts: 2
toronto
i took away @vivaldi2 thread. so cannot comment.
However, i removed the lookback and still get the same result.

my guess is that this formula is ignoring prices before 9.30 EST which is the US trading hours. How can i make it look at 24 hour charts x 5 days as the forex works that way?

[Linked Image]

Code
function run()
{
	
	BarPeriod = 30;

	
	asset("EUR/USD");
	

	
var session_high = dayHigh(ET,1); //
var session_low = dayLow(ET,1); // 
var session_pivot1 = dayPivot(ET,1); // 


plot("USUTC-1 Session High Price", session_high, MAIN, GREEN); 
plot("USUTC-2 Session Low Price", session_low, MAIN, GREEN); 
plot("USUTC-3 Session Pivot", session_pivot1, MAIN, YELLOW); 

}

Re: Can't plot daily high & low [Re: vivaldi2] #478401
Yesterday at 13:52
Yesterday at 13:52
Joined: Jul 2000
Posts: 27,029
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,029
Frankfurt
It's not a day. It's a market day. Read the manual. Forex has sessions, but I don't think it has a "daily high & low".

Re: Can't plot daily high & low [Re: vivaldi2] #478407
Yesterday at 18:39
Yesterday at 18:39
Joined: Jul 2017
Posts: 407
Z
Zheka Online
Senior Member
Zheka  Online
Senior Member
Z

Joined: Jul 2017
Posts: 407
You have to set Start/EndMarket explicitly to the times you need, or Zorro will use default values. You better do it for most of the vars yourself, not to waste time debugging unexpected results.

Doing this, you should keep in mind that:

1) Start/EndMarket are in "local market time" (while vars like StartWeek/EndWeek and Zorro's internal time are UTC)
2) setting StartMarket>EndMarket (e.g. start:1705- end:1700) which is the case for FX and futures - will not work out of the box. You will have to code around.

3) values you specify in these vars are EXCLUSIVE of that time, i.e. setting EndMarket=1700 will NOT include the bar ending 1700.

4) StartWeek/EndWeek work in 1hr increments.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1