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.

simterann22

Floor Trader Pivots @session Times

Recommended Posts

Hi all,

 

I'm posting this Floor Trader Pivots indicator because it's been modified for use with session times rather than a 'new day' crossover. For FTPs to work properly with futures or forex they must be based on the session times. eg. ES 330pm -315pm CT and forex 5pm-5pm ET (although some use other times for forex) not to mention weekend times being different from weekday times as well.

 

I found the standard TS FTP indicator does not use session times, so after a frustrating weeks search I was nearly ready to buy (hit me now!) a commercial FTP indicator.

 

The answer to my problem was from the Tradestation forum:

 

I simply had to use :

if currentsession(0)<>currentsession(0)[1]

 

instead of

 

if date<>date[1]

.

 

Here is the complete code:

 

{Floor Trader Pivots with session time use}
inputs: 
   Plot_5or7( 5), { if 7, adds plots for S3 and R3 to other 5 lines }
PlotDailyPivots ( true),
PlotWeeklyPivots (true),
PlotMonthlyPivots (true),
PlotDailyMidPts( true),
PlotWeeklyMidPts(  true),
PlotMonthlyMidPts(  true);


variables: 
    S1( 0 ), WeekS1( 0 ), MonthS1( 0 ), 
    S2( 0 ), WeekS2( 0 ), MonthS2( 0 ), 
    S3( 0 ), WeekS3( 0 ), MonthS3( 0 ), 
    R1( 0 ), WeekR1( 0 ), MonthR1( 0 ), 
    R2( 0 ), WeekR2( 0 ), MonthR2( 0 ), 
    R3( 0 ), WeekR3( 0 ), MonthR3( 0 ), 
    PP( 0 ), WeekPP( 0 ), MonthPP( 0 ),

    YestHigh( 0 ), LastWeekHigh( 0 ), LastMonthHigh( 0 ), 
    YestLow( 0 ), LastWeekLow( 0 ), LastMonthLow( 0 ),
    YestClose( 0 ), LastWeekClose( 0 ), LastMonthClose( 0 ),
    Counter( 0 ) ;

if currentsession(0) <> currentsession(0)[1] then //session times	 
//if Date <> Date[1] then //midnight open/close
begin 
{ increment Counter to be sure enough data is processed - see comment below } 
Counter = Counter + 1 ; 
YestHigh = HighD( 1 ) ; 
YestLow = LowD( 1 )  ; 
YestClose = CloseD( 1 )  ;
PP = ( YestHigh + YestLow + YestClose ) / 3 ; 
R1 = PP * 2 - YestLow ; 
R2 = PP + YestHigh - YestLow ; 
R3 = R2 + YestHigh - YestLow ; 
S1 = PP * 2 - YestHigh ; 
S2 = PP - YestHigh + YestLow ; 
S3 = S2 - YestHigh + YestLow ; 
end ;

if DayofWeek( Date ) < DayofWeek( Date[1] ) then

   begin 
  	LastWeekHigh = HighW( 1 ) ; 
LastWeekLow = LowW( 1 )  ; 
LastWeekClose = CloseW( 1 )  ; 
WeekPP = ( LastWeekHigh + LastWeekLow + LastWeekClose ) / 3 ; 
WeekR1 = WeekPP * 2 - LastWeekLow ; 
WeekR2 = WeekPP + LastWeekHigh - LastWeekLow ; 
WeekR3 = WeekR2 + LastWeekHigh - LastWeekLow ; 
WeekS1 = WeekPP * 2 - LastWeekHigh ; 
WeekS2 = WeekPP - LastWeekHigh + LastWeekLow ; 
WeekS3 = WeekS2 - LastWeekHigh + LastWeekLow ; 
end ; 

if Month( Date ) <> Month( Date[1] ) then   // detected a new month 

begin

LastMonthHigh = HighM( 1 ) ; 
LastMonthLow = LowM( 1 )  ; 
LastMonthClose = CloseM( 1 )  ;


MonthPP = ( LastMonthHigh + LastMonthLow + LastMonthClose ) / 3 ;
MonthR1 = MonthPP * 2 - LastMonthLow ; 
MonthR2 = MonthPP + LastMonthHigh - LastMonthLow ; 
MonthR3 = MonthR2 + LastMonthHigh - LastMonthLow ; 
MonthS1 = MonthPP * 2 - LastMonthHigh ; 
MonthS2 = MonthPP - LastMonthHigh + LastMonthLow ; 
MonthS3 = MonthS2 - LastMonthHigh + LastMonthLow ;



end ; 

if Counter >= 2 then { if at least one full day's data has been 
processed} 
begin
if bartype=0 then	//tick chart only
begin
	if PlotDailyPivots = true then

	begin
		if Plot_5or7 = 7 then 
		Plot1( R3, "R3" ) ; 
		Plot2( R2, "R2" ) ; 
		Plot3( R1, "R1" ) ; 
		Plot4( PP, "PP" ) ; 
		Plot5( S1, "S1" ) ; 
		Plot6( S2, "S2" ) ; 
		if Plot_5or7 = 7 then 
			Plot7( S3, "S3" ) ;
		end;
	if PlotDailyMidPts then
	begin
		Plot22((PP+S1)/2,"PPmidS1");
		Plot23((S1+S2)/2,"S1midS2");
		Plot24((S2+S3)/2,"S2midS3");
		Plot25((PP+R1)/2,"PPmidR1");
		Plot26((R1+R2)/2,"R1midR2");
		Plot27((R2+R3)/2,"R2midR3");
	end;


end;

if bartype<=1 then	//tick and intraday chart only
begin
	if PlotWeeklyPivots = true then

	begin
		if Plot_5or7 = 7 then
		Plot8( WeekR3, "WeekR3" ) ;
		Plot9( WeekR2, "WeekR2" ) ;
		Plot10( WeekR1, "WeekR1" ) ; 
		Plot11( WeekPP, "WeekPP" ) ; 
		Plot12( WeekS1, "WeekS1" ) ; 
		Plot13( WeekS2, "WeekS2" ) ; 
		if Plot_5or7 = 7 then 
		Plot14( WeekS3, "WeekS3" ) ;
	 	end;
	if PlotWeeklyMidPts then
	begin
		Plot28((WeekPP+WeekS1)/2,"WPPmidWS1");
		Plot29((WeekS1+WeekS2)/2,"WS1midWS2");
		Plot30((WeekS2+WeekS3)/2,"WS2midWS3");
		Plot31((WeekPP+WeekR1)/2,"WPPmidWR1");
		Plot32((WeekR1+WeekR2)/2,"WR1midWR2");
		Plot33((WeekR2+WeekR3)/2,"WR2midWR3");
	end;

end;
if bartype<=2 then	//tick, intraday or daily chart only
begin
	if PlotMonthlyPivots = True then

	begin
		if Plot_5or7 = 7 then 
		Plot15( MonthR3, "MonthR3" ) ; 
		Plot16( MonthR2, "MonthR2" ) ; 
		Plot17( MonthR1, "MonthR1" ) ; 
		Plot18( MonthPP, "MonthPP" ) ; 
		Plot19( MonthS1, "MonthS1" ) ; 
		Plot20( MonthS2, "MonthS2" ) ; 
		if Plot_5or7 = 7 then 
		Plot21( MonthS3, "MonthS3" ) ;
 	end;
	if PlotMonthlyMidPts then

	begin
		Plot34((MonthPP+MonthS1)/2,"MPPmidMS1");
		Plot35((MonthS1+MonthS2)/2,"MS1midMS2");
		Plot36((MonthS2+MonthS3)/2,"MS2midMS3");
		Plot37((MonthPP+MonthR1)/2,"MPPmidMR1");
		Plot38((MonthR1+MonthR2)/2,"MR1midMR2");
		Plot39((MonthR2+MonthR3)/2,"MR2midMR3");
	end;


end;

end;

 

 

Bear in mind I have hard coded the FTPs to appear a certain way based on my chart type. eg. daily pivots will not appear on anything but a tick chart, weekly will not appear on daily chart, simply because it gets too cluttered and I was tired of having to change the inputs tab everytime I changed the timeframe. Since I use multiple time frame charts next to each other I can see them all together. I personally like to see the FTPs as lines, but you can eliminate the 'joining lines' as the FTPs change by using left ticks or dots.

 

Some issues:

 

1) Tick chart FTPs may be slightly different from correct daily, weekly etc.. This I believe is because of the 'lack of time factor'. I don't know of a solution for this other than keeping an intraday pivot chart next to your tick chart. The Data2 solution (below) does not work with tick charts either. Any ideas?

 

2) This indicator WILL NOT WORK on a futures day session chart eg. ES.D in its current format above as it does not take into account the highs and the lows of the overnight session. However you could add a hidden Data2 (plot DAILY Globex) and change the code regarding yesterday's H,L and C.

 

YestHigh = HighD( 1, data2) ; 
 YestLow = LowD( 1 , data2)  ; 
 YestClose = CloseD( 1, data2)  ;

 

3) Make sure you set the minimum range to say 2 months so that your monthly and weekly FTPs will be correct.

 

Make sure when you have plotted the indicator that you check a reliable Pivot website and crosscheck your data. I find I need to set up a custom session (I call Globex) set with the exact Globex futures times for the FTPs to be accurate.

 

BTW does anyone know how to code to plot differently for different minute or tick timeframes eg. 5min compared to 240min etc.? I find the 'bartype' reserved word a little to inflexible.

 

Enjoy.

FLOOR_TRADER_PIVOTS_SESSION_TIMES.ELD

5aa70ef2af423_FlorrTraderPivotsSessionTimes.thumb.png.3491ebc92e393d9cc3b424f33338af8a.png

Edited by simterann22

Share this post


Link to post
Share on other sites

Excited to download this b/c I am tired of manually putting them in everyday however not sure if I need to copy and paste the code or download the file? I have tried both and not having any luck. Any suggestions?

Share this post


Link to post
Share on other sites

Sorry, I have to ask some silly questions first:

 

Did the ELD install?

Did you verify the 'cut and paste version'?

Did you get anything on your screen?

Did you apply it to 'Use Same Axis as Underlying Data'?

Share this post


Link to post
Share on other sites
Yes the file did install and the verification failed. Any suggestions? (it didn't like the word criteria). thks for your time!

 

 

what program/version are you using?

 

pls copy and paste the error message here.

(or a screen shot)

Share this post


Link to post
Share on other sites
Yes the file did install and the verification failed. Any suggestions? (it didn't like the word criteria). thks for your time!

 

Again....have to ask the silly questions......

 

I'm assuming you cut and paste the code as a new indicator, and not installed via the ELD, since you say you verified it. Yeah? If so, did you make a new 'indicator' or did you mistakenly make a new paintbar, showme or function? :crap:

 

Here is a copy of the code in text file just in case you missed any code while copying it:

FTPs @Sessiontimes.txt

Share this post


Link to post
Share on other sites

How can I plot FTP's with only the Levels that are close to the current prices. My chart plots all FTP lines on the chart at all times , condensing the price bars.

Thank you for this indicator.

Share this post


Link to post
Share on other sites

I looked into doing a similar thing. This is an idea from the TS Forums:

 

Suppose you're trying to plot value1, and you don't want it plotted unless price gets within 2 big points. Format your plot as one of Point, Cross, Left Tic or Right Tic (cannot be Line), and modify your code to the following:

 

 

 

input:

plotThreshold(2);

 

...

 

if absValue(C-value1)<=plotThreshold then

plot1(value1,"Bull");

 

******* So you could insert this into your FTP code******

 

The reason I do not use it is because it does not plot nicely on the chart.... a pivot line will look like it's been hacked to pieces, only appearing as a dot, tick etc if an individual bar high comes near it.

 

I simply do not "Expand Range to Include Analysis Techniques" and I only see those pivots that appear within my chart range. Another alternative is to comment out the plots for monthly and weekly S and Rs but that's just a Bandaid job in my opinion.

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

    • HLF Herbalife stock, watch for a bull flag breakout above 9.02 at https://stockconsultant.com/?HLF
    • Date: 1st April 2025.   Will Gold’s Rally Hold Strong as New Trade Tariffs Take Effect Tomorrow?   Gold continues to increase in value for a sixth consecutive day and is trading more than 17% higher in 2025. Amid fear of higher inflation, a recession and the tariffs war escalating investors continue to invest into Gold pushing demand higher. The trade policy from April 2nd onwards continues to be a key factor for the whole market. Can Gold maintain its upward trend? Trade Policy From Tomorrow Onwards Starting as soon as tomorrow, a 25% tariff will be imposed on all passenger cars imported into the United States. While this White House policy is anticipated to negatively affect European industrial performance, it will also lead to higher transportation and maintenance costs for everyday American taxpayers. The negative impact expected on both the EU and US is one of the reasons investors continue to buy Gold. Additionally, last month, President Donald Trump announced reciprocal sanctions against any trade partners that impose import restrictions on US goods. Furthermore, tariffs on products from Canada and the EU could increase even more if they attempt to coordinate a response. Overall, investors continue to worry that new trade barriers will prompt retaliatory measures, particularly from China, the Eurozone, and Japan. Any retaliation is likely to escalate the trade conflict and prompt another reaction from the US. Experts at Goldman Sachs and other investment banks warn that this will lead to rising inflation and unemployment. They also caution that it could effectively halt economic growth in the US.   XAUUSD 1-Hour Chart   The Weakness In The US Dollar Another factor which is allowing the price of XAUUSD to increase in value is the US Dollar which has been unable to maintain any bullish momentum. Despite last week’s Core PCE Price Index rising to its highest level since February 2024, the US Dollar has been unable to see any significant rise in value. Due to the US Dollar and Gold's inverse correlation, the price of Gold is benefiting from the Dollar weakness. Investors worry that new trade barriers will prompt retaliatory measures from China, the Eurozone, and Japan, potentially escalating the conflict. Experts at The Goldman Sachs Group Inc. believe that such actions by the US administration will drive rising inflation and unemployment while effectively halting economic growth in the country. Can Gold Maintain Momentum? When it comes to technical analysis, the price of Gold is not trading at a price where oscillators are indicating the instrument is overbought. The Relative Strength Index currently trades at 68.88, outside of the overbought area, since Gold’s price fell 0.65% during this morning’s session. However, even with this decline, the price still remains 0.40% higher than the day’s open price. In terms of fundamental analysis, there continues to be plenty of factors indicating the price could continue to rise. However, the price movement of the week will also partially depend on the employment data from the US. The US is due to release the JOLTS Job Vacancies for February this afternoon, the ADP Non-Farm Employment Change tomorrow, and the NFP Change and Unemployment Rate on Friday. If all data reads higher than expectations, investors may look to sell to lock in profits at the high price. Key Takeaway Points: Gold’s Rally Continues – Up 17% in 2025 as investors seek safety from inflation, recession fears, and trade tensions. Trade War Impact – New US tariffs and potential retaliation from China, the EU, and Japan drive uncertainty, boosting Gold demand. Weak US Dollar – The Dollar’s struggle supports Gold’s rise due to their inverse correlation. Gold’s Outlook – Uptrend may continue, but US jobs data could trigger profit-taking. 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.
    • Date: 31st March 2025.   Trump Confirms Tariffs on All Countries, Sending Stocks Lower.   The NASDAQ continues to trade lower due to the US confirming the latest tariffs will be on all countries. In addition to this, bearish volatility also is largely due to the higher inflation data from Friday. The NASDAQ declines to its lowest price since September 11th 2024. Core PCE Price Index - Inflation Increases Again! The PCE Price Index read 2.5% aligning with expert forecasts not triggering any alarm bells. However, the Core PCE Price Index rose from 0.3% to 0.4% MoM and from 2.7% to 2.8% YoY, signalling growing inflationary pressure. This increases the likelihood that the Federal Reserve will maintain elevated interest rates for an extended period. The NASDAQ fell 2.60% due to the higher inflation reading which is known to pressure the stock market due to pressure on consumer demand and a more hawkish Federal Reserve. Boston Fed President Susan Collins recently commented that tariffs could drive up inflation, though the long-term impact remains uncertain. She told journalists that a short-term spike is the most probable outcome but believes the current pause in monetary policy adjustments is appropriate given the prevailing uncertainties. Although, certain investment banks such as JP Morgan actually believe the Federal Reserve will be forced into cutting rates. This is due to expectations that the economy will struggle under the new trade policy. For example, JP Morgan expects the Federal Reserve to delay rate cuts but will quickly cut towards the end of 2025. Market Risk Appetite Takes a Hit! A big factor for the day is the drop in the risk appetite of investors. This can be seen from the VIX which is up almost 6%, Gold which is trading 1.30% higher and the Japanese Yen which is the day’s best performing currency. Most safe haven assets, bar the US Dollar, increase in value. It is also worth noting that all indices are decreasing in value during this morning's Asian session with the Nikkei225 and NASDAQ witnessing the strongest decline. Previously the stock market rose in value as investors heard rumours that tariffs would only be on certain countries. This bullish swing occurred between March 14th and 25th. Over the weekend, President Donald Trump indicated that the upcoming tariffs would apply to all countries, not just those with the largest trade imbalances with the US. NASDAQ - Technical Analysis In terms of technical analysis, the NASDAQ continues to obtain indications that sellers control the price action. The price opens on a bearish price gap measuring 0.30% and trades below all Moving Averages on all timeframes. The NASDAQ also trades below the VWAP and almost 100% of the most influential components (stocks) are declining in value.     The next significant support level is at $18,313, and the resistance level stands at $20,367.95. Key Takeaway Points: NASDAQ falls to its lowest since September 2024 as the US confirms tariffs on all countries, adding to inflation concerns. Core PCE inflation rises to 0.4% MoM and 2.8% YoY, increasing the likelihood of prolonged high interest rates. Investor risk appetite drops as VIX jumps 6%, gold gains 1.3%, and safe-haven assets outperform. NASDAQ shows strong bearish momentum, trading below key technical levels with support at $18,313 and resistance at $20,367.95. 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.
    • PM Philip Morris stock, top of range breakout at https://stockconsultant.com/?PM
    • EXC Exelon stock, nice range breakout at https://stockconsultant.com/?EXC
×
×
  • Create New...

Important Information

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