Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

chloe31

Automatic Pivots Calculation - Help

Recommended Posts

Hello,

 

I use the attached MC code to calculate the daily pivot points automatically. This calculation works very well when the session starts and ends in the same day (as an example, for futures on CAC40 (FCE), which opens at 8.00 am and closes at 10.00 pm in the same day). But for futures such as crude oil (CL), which opens at 6.00 pm and closes at 5.15 pm the next day, the automatic pivot points calculation does not work. :confused:

I would like to request your help to modify this code to take into account futures contracts whose session spreads on two days.

 

Thank you in advance for your help

Best regards,

 

Chloe

TTM DAILY PIVOTS.pla

Share this post


Link to post
Share on other sites

Plotting overnight high/low, that is a similar concept as they span two days, has been discussed before. Just search the forum for the examples and you should be able to adjust your code.

 

btw, I've noticed looking at your previous posts that the only time you post is when you need help installing, or modifying indicators. Everyone needs help sometimes, but forums are about give and take, not just about taking.

Share this post


Link to post
Share on other sites

Hello Sevensa,

 

I am realy sorry, but I am not very good at programming and my knowledge of the Easylanguage is limited. Therefore, it is very hard for me to provide help on the forum when people ask question related to coding. If I can help, I do it with great pleasure.

 

You wrote: " I've noticed looking at your previous posts that the only time you post is when you need help installing, or modifying indicators". I am sorry, but please look at my previous post again ! I posted two codes in the file TTM anchor, so I do not post only when I need help.

 

Chloe

Share this post


Link to post
Share on other sites

what Sevensa said was, this is a community... don't treat people like your personal tech support. Don't just come here when you needed help, and disappear when you are done. Everybody has something to offer, even the newest newbie... nobody asks you to share something that you are not good at (eg EL)... but how about some TA insight? or what is your rationale for trying to achieve what you want to do? Many people on this forum are long term consistently profitable traders, I don't think we "need" your "grail". We are more interested in helping traders to move up on their own ladder. The best way to solicite "help" is to have a dialog... without disrespect, I can tell you, 99% of the "help request" leads to nowhere; people are either analyzing the wrong thing, of putting too much energy on deciphering something that gives very little high quality trading signals, or something that gives lots of low quality trading signals. If you see people asking a seemingly simple technical question, but nobody bothers to answer... that's not because we are too snobbish to answer... but because we don't want to waste your time...

Edited by Tams

Share this post


Link to post
Share on other sites

Hello Tams,

 

I really do not understand why you are so agressive against me: "Don't just come here when you needed help, and disappear when you are done". I come on this forum each day, not only when I need help. Last week, a member of this forum sent a mail to me to request help to install the TTM anchor. I tried to help him as much as possible, so I think i offer my help in that case.

 

what is your rationale for trying to achieve what you want to do ? I trade CL, ES, YM, FCE with pivots point approach. I discovered that the code I used to calculate the pivot points was wrong with futures contracts whose session spread on two days. So, I would like to modify this code in order to have a good calculation of the pivot points, which I use for my daily trading.

 

The best way to solicite "help" is to have a dialog... without disrespect. I fully agree with you Tams. So, what do I have to do to silicite your hep ?

 

Thank you in advance

 

Best regards

Chloe

Share this post


Link to post
Share on other sites

nah... i am not aggressive against you... i have no need to

if my message was directed to you alone, i would have quoted you in my post.

this is a general message... it is the idea of community that i want to convey... a continuation of what sevensa was trying to say.

Share this post


Link to post
Share on other sites
... So, what do I have to do to silicite your hep ?

 

Thank you in advance

 

Best regards

Chloe

 

 

I like to help people who want to help themselves...

not everyone like my style, which is fine with me and fine with them.

 

i realize not everybody can think in terms of programming languages,

i would code for people who absolutely cannot code.

but before we get into coding, I would like to see what you have tried...

 

 

(ps. if I were to hand it to you without your participation, I would have to charge you for it, wouldn't I?)

Edited by Tams

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 ;

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

added inputs for session times


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


input: SessStart(1803),SessEND(1615);

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


SessReset = t = SessEnd;
CamarillaReset = t = SessStart;

if SessReset then
begin

var0 = var0 + 1 ;
var1 = var2 ;
var3 = var4 ;
var5 = var6 ;
var7 = Close;
end;

if CamarillaReset then
begin

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 ;

Share this post


Link to post
Share on other sites
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.

Blow Fish

 

Actually Blow Fish, if I consider it time well spent, how can you judge from me that it's a waste of my time? If I can help Chloe, I will and thanks for mentioning the link again... I'll check it.

 

Anyway, I know that you're a good contributor as are the others and thanks for the comments.

 

And it's Ranger not ranger.

Share this post


Link to post
Share on other sites

Hello Everybody,

 

@Blowfish,

 

I have well understood your message. As I have already written, I will try to work this week-end in order to code something, based on your inputs (threat ,..).

Nevertheless, can you tell me what is the interest to have a coding forum here if we cannot request help for coding without being critisized ?

 

@Ranger,

 

Many thanks for your help, but I do not want you to sprend a lot of time on this code. I do not want you to waste you time. I do not know how to thank you !

 

@ Statsign,

 

Thank you very much for having modified the code coming from Ranger. I do not know how to thank you !

I will try this code this week-end, and I will try to code something.

I will keep you informed.

 

Thank you a lot !

Best regards

Chloe

Share this post


Link to post
Share on other sites
Blow Fish

 

Actually Blow Fish, if I consider it time well spent, how can you judge from me that it's a waste of my time? If I can help Chloe, I will and thanks for mentioning the link again... I'll check it.

 

Anyway, I know that you're a good contributor as are the others and thanks for the comments.

 

And it's Ranger not ranger.

 

Edit: I should say this is not to chastise Chloe, they seem to have had the brunt of it recently :D Simply in response to Ranger.

 

It's your time do as you please with it :) If you will learn something from it great. If you want to help someone that is to 'busy' to help themselves that is fine too.

 

The aforementioned thread has 2 or 3 (or maybe more) solutions to the problem presented.

 

Give a man a fish and you feed him for a day teach a man to fish and you feed him for life. You can lead a horse to water but you can not make him drink. Ok enough of the proverbs already.

 

I would have posted code that plot pivots, mid points, labels, price labels, irregular sessions, split sessions, multiple sessions (e.g. 2.5 days 5 days) weekly pivots, monthly pivots, etc. etc. Unfortunately I am a little busy right now.

Edited by BlowFish

Share this post


Link to post
Share on other sites

Blowfish,

 

You are a very funny guy !!

For your information, yesterday, I spent 2 hours from 1 amto 3 am, trying to find a solution to my problem, but with no succes. I am not as good as you at coding

 

I will try again this week end.

So, please stop writting this kind of sentence "someone that is to 'busy' to help themselves ", as it is absolutly wong for me. How can you judge me, you do not know me !!

 

Best regards,

Chloe

Share this post


Link to post
Share on other sites

this is funny

really funny

 

i am not trying to be sarcastic,

i am not a programmer, i know the pain you are going through.

 

but if you would just stop banging your head... and R-E-A-D,

you will find that the 2 really nice regular contributors here

have already given you the answer to your problem in post #2 and post #3.

(or should I say, pointed you to the right direction)

 

in case you still don't understand what they are talking about,

let me paraphrase...

 

Your request is not unique, nor was it asked the first time.

Various methods have been discussed.

The solution to your quest has already been DONE.

The code is posted in the "thread".

You can adjust it to meet your need.

The name of the thread is called "plotting globex highs and lows" or something like that...

Furthermore, there are several interesting approach to solve the problem,

and they are all presented in the thread.

 

hope the above helps

Edited by Tams

Share this post


Link to post
Share on other sites
this is funny

really funny

 

i am not trying to be sarcastic,

i am not a programmer, i know the pain you are going through.

 

but if you would just stop banging your head... and R-E-A-D,

you will find that the 2 really nice regular contributors here

have already given you the answer to your problem in post #2 and post #3.

(or should I say, pointed you to the right direction)

 

in case you still don't understand what they are talking about,

let me paraphrase...

 

Your request is not unique, nor was it asked the first time.

Various methods have been discussed.

The solution to your quest has already been DONE.

The code is posted in the "thread".

You can adjust it to meet your need.

The name of the thread is called "plotting globex highs and lows" or something like that...

Furthermore, there are several interesting approach to solve the problem,

and they are all presented in the thread.

 

hope the above helps

Tams

 

Gone through allot of your programming solutions and excellent tips.

 

You do nice work!

Share this post


Link to post
Share on other sites

Statsign

 

thanks for the modifications - glad you were able to help chloe.

 

Ranger

 

 

 

 

 

 

added inputs for session times


{plots previous day hi/low/close - open {x} out below}
{plots camarilla lines}
{rev date 07aug09}


input: Sessstart(1803),sessend(1615);

variables:
Var0( 0 ) ,
var1( 0 ) ,
var2( 0 ) ,
var3( 0 ) ,
var4( 0 ) ,
var5( 0 ) ,
var6( 0 ) ,
var7( 0 ) ,
var8( 0 ) ,
sessreset( false ) ,
camarillareset( false ) ;


sessreset = t = sessend;
camarillareset = t = sessstart;

if sessreset then
begin

var0 = var0 + 1 ;
var1 = var2 ;
var3 = var4 ;
var5 = var6 ;
var7 = close;
end;

if camarillareset then
begin

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 ;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • Date: 21st February 2025.   European PMI Disappoint, Weighing on Euro Before German Elections   The Euro is the first currency to witness the volatility on this month’s PMI reports. The French, German and British PMI data have resulted in the Euro being the worst-performing currency of the European Session so far. However, will the Euro continue to decline throughout the day? European Purchasing Managers’ Indexes The French Purchasing Managers Index was the first European index to be made public. The release resulted in the Euro instantly declining 0.24%. The main concern from the French data was the Services PMI which fell from 48.2 to 44.5. Previously the market was expecting the data to remain more or less unchanged. The weak data triggered the decline which came to a halt after Germany’s PMI was released.     The German Manufacturing PMI read 0.5 points higher than previous expectations and the Services PMI was 0.2 points lower. The data from Germany was a relief for Euro investors and the price rose 0.12% higher. However, traders should note that the price of the EURUSD continues to remain 0.20% lower than yesterday’s close. The price of the EURUSD will now depend on the PMI data from the US. The value of the US Dollar will depend on its PMI release this afternoon and the Consumer Sentiment Index. Analysts expect both the US Services and Manufacturing PMI data to remain above the 50.00 level in the expansion zone. German Elections 2 Days Away Germany is set to hold a general election this Sunday, February 23rd, following the collapse of the coalition of social democrats, liberals, and greens. Given the country's highly proportional electoral system, German polls provide a strong indication of potential government formations post-election. The main concern for Germany is the AFD party who are Far-Right Nationalists. Currently, ahead in the polls are CDU (centre-right), and AFD (far right), followed by the SPD (centre-left). Traders should note that the results of the elections are likely to trigger strong volatility on Monday, but also influence volatility today. Economists may become further concerned if the far-right gains power for the first time due to uncertainty. If the government, similar to France, is unable to form a coalition, this would also be a concern for the Eurozone. Furthermore, the Euro this week is also under pressure from comments from members of the European Central Bank. ECB Governing Council member Fabio Panetta said to journalists that officials need not slow interest rate cuts, as January's 2.5% inflation is still expected to reach the 2.0% target this year. He also advised the European economy is weaker than previously expected. EURUSD - Technical Analysis and Indicators The EURUSD is trading above the 75-bar Exponential Moving Average and 100-bar Simple Moving Average on the 2-hour chart. However, the price is moving away from the key resistance level at 1.05058 indicating the price is losing momentum. The short-term volatility is indicating the price is retracing downwards. On the 5-minute timeframe, the price is trading below the 200-bar SMA and is also forming clear lower lows and highs. Simultaneously, the US Dollar Index is trading above the 200-bar SMA on the 5-minute chart confirming no current conflicts. Currently, the US Dollar is the best-performing currency of the day attempting to regain losses from the past 2 weeks. Watch today’s Live Analysis Session for more signals as they develop!   Key Takeaway Points: Weak French Services PMI triggered an initial Euro decline, but German PMI provide a slight relief. However, EURUSD remains lower than yesterday’s close. The Euro’s direction now depends on the US PMI reports, with analysts expecting US data to stay in expansion territory. Sunday's German election could drive volatility, especially if the far-right AFD gains power or if coalition formation proves difficult. ECB official Fabio Panetta suggested no need to slow rate cuts, citing weaker-than-expected economic performance and expected inflation decline. Always trade with strict risk management. Your capital is the single most important aspect of your trading business.   Please note that times displayed based on local time zone and are from time of writing this report.   Click HERE to access the full HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news.   Michalis Efthymiou HFMarkets   Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in Leveraged Products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • BE Bloom Energy stock, watch for a range breakout, target 34 area at https://stockconsultant.com/?BE
    • APLD Applied Digital stock. nice rally, watch for a top of range breakout at https://stockconsultant.com/?APLD
    • UAL United Airlines stock, watch for a narrow range breakout, target 122 area at https://stockconsultant.com/?UAL
    • WBD Warner Bros Discovery stock, watch for a range breakout at https://stockconsultant.com/?WBD
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.