Dear All,
How can you ask powerlanguage to give you the highest high, lowest low, open and close of the previous day?
dailyhigh(0), dailylow(0) etc. do not seem to work.
I am trying to programme trendlines for pivot points..
Many thanks,
[PL] Daily"ohlc"
- Bruce DeVault
- Posts: 438
- Joined: 19 Jan 2010
- Location: Washington DC
- Been thanked: 2 times
- Contact:
Take a look at the functions OpenD, HighD, LowD and CloseD if you are using intraday data. That is what they do. Or, you can write something that does this by simply watching when date <> date[1] and keeping track of it in a few lines of code (see how the functions above work for an example of how.)
Dear Bruce,
Thank you for your reply. This is what I was looking for.
I use the following to calculate the pivot point:
But var0 returns 1 and sends the candlesticks high up the window.
Is there anything wrong in this code?
Many thanks,
Thank you for your reply. This is what I was looking for.
I use the following to calculate the pivot point:
Code: Select all
var0 = ( HighD( 1 ) + LowD( 1 ) + CloseD( 1 ) ) / 3;
plot1( var0, "Pivot Point" );
Is there anything wrong in this code?
Many thanks,
- Bruce DeVault
- Posts: 438
- Joined: 19 Jan 2010
- Location: Washington DC
- Been thanked: 2 times
- Contact:
Perhaps you are referring to the fact that the functions return -1 when on the first date, and thus there isn't any previous date's information to return. The average of three numbers all of which are -1 is still -1. You simply need to check for this.
Code: Select all
variables: var0(0);
var0 = ( HighD( 1 ) + LowD( 1 ) + CloseD( 1 ) ) / 3;
if var0 > 0 then plot1( var0, "Pivot Point" );
- Bruce DeVault
- Posts: 438
- Joined: 19 Jan 2010
- Location: Washington DC
- Been thanked: 2 times
- Contact:
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
the best pivot study ever:
ABC_Floor Trader Pivots V3
http://forum.tssupport.com/viewtopic.php?t=4542
@ PLEditor, use FILE > IMPORT
ABC_Floor Trader Pivots V3
http://forum.tssupport.com/viewtopic.php?t=4542
@ PLEditor, use FILE > IMPORT