Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 02-15-2010, 05:27 AM   #9

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Automatic Pivots Calculation - Help

Take a look at the thread mentioned Chloe. I thought it was particularly good as a couple of programming novices came up with solutions. It was a good example of 'teach a man to fish'.

I do understand that a lot of traders will not want to expend energy programming and indicators.
BlowFish is offline  
Reply With Quote
Old 02-15-2010, 03:44 PM   #10

Join Date: Mar 2009
Location: Toulouse
Posts: 24
Ignore this user

Thanks: 14
Thanked 2 Times in 2 Posts



Re: Automatic Pivots Calculation - Help

Hello,

Ok Tams and Blowfish. I will try to code something, but I do not know how to start !! I will read the thread you advise. I will see if I can find an idea.

Regards
Chloe
chloe31 is offline  
Reply With Quote
Old 02-16-2010, 01:00 PM   #11

Join Date: Oct 2009
Location: Port St Lucie
Posts: 62
Ignore this user

Thanks: 13
Thanked 29 Times in 21 Posts



Re: Automatic Pivots Calculation - Help

Hi Chloe

Take a look at this simple code. It plots Camarilla Lines and Yesterdays OHLC(Open rem out)

Perhaps put this on your other contracts and if it works for you then you can modify the arithmetic to account for your pivots.

If you need some additional help - check me back!

{Plots previous day Hi/Low/Close - Open {x} Out below}
{Plots Camarilla Lines}
{Rev date 07Aug09}

variables:
var0( 0 ) ,
var1( 0 ) ,
var2( 0 ) ,
var3( 0 ) ,
var4( 0 ) ,
var5( 0 ) ,
var6( 0 ) ,
var7( 0 ) ,
var8( 0 ) ;

if Date <> Date[1] then
begin

var0 = var0 + 1 ;
var1 = var2 ;
var3 = var4 ;
var5 = var6 ;
var7 = Close[1] ;
var2 = Open ;
var4 = High ;
var6 = Low ;
end
else
begin
if High > var4 then
var4 = High ;
if Low < var6 then
var6 = Low ;
end ;
condition1 = var0 >= 2 and BarType < 3 ;

value10 = ((var3 - var5)*(1.1/2)) + var7 ; {H4}
value20 = ((var3 - var5)*(1.1/4)) + var7 ; {H3}
value30 = ((var3 - var5)*(1.1/6)) + var7 ; {H2}
value40 = ((var3 - var5)*(1.1/12)) + var7 ; {H1}
value50 = var7 - ((var3 - var5)*(1.1/12)) ;{L1}
value60 = var7 - ((var3 - var5)*(1.1/6)) ;{L2}
value70 = var7 - ((var3 - var5)*(1.1/4)) ;{L3}
value80 = var7 - ((var3 - var5)*(1.1/2)) ; {L4}

if condition1 then

begin
Plot1( var1, "Y-O" ) ;
Plot2( var3, "Y-H" ) ;
Plot3( var5, "Y-L" ) ;
Plot4( var7, "Y-C" ) ;
Plot10( value10, "H4" ) ;
Plot20( value20, "H3" ) ;
Plot30( value30, "H2" ) ;
Plot40( value40, "H1" ) ;
Plot50( value50, "L1" ) ;
Plot60( value60, "L2" ) ;
Plot70( value70, "L3" ) ;
Plot80( value80, "L4" ) ;
end ;
Ranger is offline  
Reply With Quote
Old 02-16-2010, 03:46 PM   #12

Join Date: Mar 2009
Location: Toulouse
Posts: 24
Ignore this user

Thanks: 14
Thanked 2 Times in 2 Posts



Re: Automatic Pivots Calculation - Help

Hello Ranger,

Thank you very much for you help, I really appreciated.

I tried your code on CL contract (Mar 10)

Today is Tuesday. So, the session on CL started at 6.00 pm (EST time) and will end on Wednesday at 5.15 pm (EST time).
The previous session started at 6.00 pm (EST time) on Monday and ended on Tuesday at 5.15 pm (EST time).
To calculate the pivot points, I need the High, the Low and the Close pf the session that started at 6.00 pm (EST time) on Monday and ended on Tuesday at 5.15 pm (EST time). These values are as follows:
- High = 74.36
- Low = 73.71
- Close = 73.96

I tried your code, but it seems that your pivots are calculated on a session that starts at 12 am and ends at 11.59 p.m the same day. Am I right ?
How can I modify it to calculate pivots on a session that starts at 6.00 pm (EST time) on Monday and ends on Tuesday at 5.15 pm (EST time) ?

Many thanks in advance for your help

Bets regards,
Chloe
chloe31 is offline  
Reply With Quote
Old 02-16-2010, 04:00 PM   #13

Join Date: Nov 2006
Location: N/A
Posts: 613
Ignore this user

Thanks: 62
Thanked 294 Times in 177 Posts



Re: Automatic Pivots Calculation - Help

Quote:
Originally Posted by chloe31 »
Hello Ranger,

Thank you very much for you help, I really appreciated.

I tried your code on CL contract (Mar 10)

Today is Tuesday. So, the session on CL started at 6.00 pm (EST time) and will end on Wednesday at 5.15 pm (EST time).
The previous session started at 6.00 pm (EST time) on Monday and ended on Tuesday at 5.15 pm (EST time).
To calculate the pivot points, I need the High, the Low and the Close pf the session that started at 6.00 pm (EST time) on Monday and ended on Tuesday at 5.15 pm (EST time). These values are as follows:
- High = 74.36
- Low = 73.71
- Close = 73.96

I tried your code, but it seems that your pivots are calculated on a session that starts at 12 am and ends at 11.59 p.m the same day. Am I right ?
How can I modify it to calculate pivots on a session that starts at 6.00 pm (EST time) on Monday and ends on Tuesday at 5.15 pm (EST time) ?

Many thanks in advance for your help

Bets regards,
Chloe
Doesn't the thread we referred you to, explains exactly that with Globex High/Low? Other than wanting someone to write the code for you, since the answer was already provided, I am not sure what more you are looking for?
sevensa is offline  
Reply With Quote
Old 02-16-2010, 04:15 PM   #14

Join Date: Mar 2009
Location: Toulouse
Posts: 24
Ignore this user

Thanks: 14
Thanked 2 Times in 2 Posts



Re: Automatic Pivots Calculation - Help

Sevensa,

I am really sorry but:

1) today, I have no time to go to the Thread you advise me.
2) Ranger wrote: If you need some additional help - check me back!, that is the reason why I asked him my question: How can I modify it to calculate pivots on a session that starts at 6.00 pm (EST time) on Monday and ends on Tuesday at 5.15 pm (EST time) ?

I will try to code something based on the Thread you advise me, but not before this week-end.

Chloe
chloe31 is offline  
Reply With Quote
Old 02-16-2010, 10:24 PM   #15

Join Date: Oct 2009
Location: Port St Lucie
Posts: 62
Ignore this user

Thanks: 13
Thanked 29 Times in 21 Posts



Re: Automatic Pivots Calculation - Help

Hi Chloe

Oh Boy ... you may need to renew your fan base. Perhaps send them chocolate chip cookies or hemlock ;o)

OK, I understand the issue more clearly .... let me see, if I can help you.

Cheers!!! michael
Ranger is offline  
Reply With Quote
Old 02-17-2010, 05:14 AM   #16

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Automatic Pivots Calculation - Help

Chloe I think the reason people are reticent is that you are expecting them to spend time to help but you are "too busy" to try to help yourself. I guess you can see how this might look lazy? If you are too busy to devote any time to this then perhaps you should wait until you have half an hour or so to spare?

The thread has the answers you seek. If you have difficulty understanding them then I am sure people will help you. They are unlikely to help if you have not done anything to help yourself. Actually strike that, looks like you have got ranger to waste there time re-inventing the wheel for you.
BlowFish is offline  
Reply With Quote
The Following 2 Users Say Thank You to BlowFish For This Useful Post:
sevensa (02-17-2010), Tams (02-17-2010)

Reply

Tags
pivot, price volume relationship

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gold,Dollar and Euro Calculation mehtaka Beginners Forum 7 06-17-2010 10:08 AM
Tick Size Calculation PeterBrazel Coding Forum 1 08-17-2009 09:55 PM
Trendlines Automatic dhelmin Coding Forum 1 06-29-2009 10:10 PM
Trend Lines Automatic khagans Coding Forum 1 02-25-2009 01:01 AM
Capital Progression Calculation in Perl Sparrow Coding Forum 4 03-07-2008 10:33 AM

All times are GMT -4. The time now is 04:59 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.