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: 28th March 2024. The US Dollar Strengthens As Economists Believe The ECB Will Struggle To “Hold”. Early this morning, the Fed Governor advised “there is no rush to cut rates” and “the data within the upcoming months” will be vital. The US Dollar Index rises to a 1-month high. The value of the USD will largely be based on today’s data on economic growth, consumer sentiment and pending home sales. Dollar and index traders are closely monitoring tomorrow’s Core PCE Price Index which analysts expect will read 0.3%. A higher inflation reading can potentially pressure stocks and support the Dollar. Strong declines in NVIDIA and Netflix stocks pressured the NASDAQ on Wednesday. Though, buyers entered late in the session to boost the overall price. EURUSD The latest comments from members of the Federal Reserve are supporting the US Dollar. The forward guidance between members of the Federal Reserve is mainly not aligned. The Chairman advises the Fed does not need much more proof for the regulator to feel comfortable reducing rates. Whereas the Fed Governor, Mr Waller, advises there is no rush, and he wants to see a few months of data before determining the next move. Therefore, the upcoming inflation and employment data will remain vital and could even push back rate hikes further. According to economists, the Federal Reserve will cut the interest rate on 3 occasions this year, but the timing of the first cut is less certain and may change depending on upcoming data. A positive factor for traders is that EURUSD exchange is not witnessing conflicting currencies. The US Dollar is trading 0.12% higher while the Euro is declining against most currencies. The Euro is trading 0.06% lower against the Pound and the Canadian Dollar and 0.16% lower against the Japanese Yen. Yesterday, the head of the Bank of Italy, Mr Cipollone, said that the authorities were confident that inflation would return to the target of 2.0% by mid–2025. He also supports the lower of interest rate and will use this as a basis for adjusting monetary policy. The Euro is generally under pressure as investors believe the European Central Bank will struggle to avoid cuts if the Fed decide to delay their adjustments. The US Dollar will be influenced by four major economic data releases. The US Final GDP, Weekly Unemployment Claims, Pending Home Sales and Consumer Sentiment Index. If these read higher than expectations with the weekly unemployment claims dropping, the US Dollar is likely to witness further support. However, investors should note the main release will be tomorrow’s Core PCE Price Index. Traders are expecting no major news for Europe and volatility levels may fall tomorrow as European markets are closed for Easter. Technical analysis currently points towards a continued downward trend. The price is trading below the neutral on the RSI and below the 75-Bar EMA. However, investors should note this will also be dependent on upcoming US data. USA100 The price of the USA100 was under pressure throughout the whole US session but was saved by an increased volume of buyers late in the session. However, a positive point is the components held onto their value. Even though the index fell in value, only 28% of the components declined. Investors will now turn their attention towards tomorrow’s PCE Price Index and the upcoming earnings season which will start in mid-April. The price is now trading slightly above the Moving Averages but slightly below the 50.00 on the RSI. Therefore, technical analysis remains at the “neutral” level and continues to indicate a larger price range. If today’s economic data is positive the stock market can witness confidence and support as this continues to indicate a soft landing. Though, if the data is too strong, it could also trigger a hawkish Fed which is known to be negative for the USA100. 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 on how markets work. Click HERE to register for FREE! Click HERE to READ more Market news. Michalis Efthymiou Market Analyst 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 FX and CFDs 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.
    • $IBKR Interactive Brokers stock narrow range breakout watch above 111.16 , see https://stockconsultant.com/?IBKR
    • $ISRG Intuitive Surgical stock narrow range breakout watch above 403.07 , see https://stockconsultant.com/?ISRG
    • $JETS ETF top of range breakout watch above 20.61 , see https://stockconsultant.com/?JETS
    • $KKR KKR stock bull flag breakout watch above 102.64 , see https://stockconsultant.com/?KKR
×
×
  • Create New...

Important Information

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