NexusFi: Find Your Edge


Home Menu

 





Having trouble with a futures indicator working incorrectly on Sunday/Monday session


Discussion in EasyLanguage Programming

Updated
    1. trending_up 2,592 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 1 attachments




 
Search this Thread

Having trouble with a futures indicator working incorrectly on Sunday/Monday session

  #1 (permalink)
stevemkay
greenville, sc
 
Posts: 2 since Jul 2021
Thanks Given: 1
Thanks Received: 0

I have written/ hacked together the following easy language indicator. The closing price is taken at 1600hrs and begins plotting for the next session immediately. I am having trouble with Sunday evenings then Monday sessions with the indicator recalculaing when it shouldnt until Monday at 1600. Please see the attached screenshots. It will make a lot more sense.
 
Code
vars: 
DayPivot(0),
Mid(0), 
ThreeDHigh(0),
ThreeDLow(0),
PivotDiff(0),
ThreeDRangeHigh(0),
ThreeDRangeLow(0),
OncePerDay(0),
ThreeDPP(0),
SecondNumber(0);
 
If date > date[1] then OncePerDay = 0 ;
If Time > 1600 and OncePerDay = 0
then begin

	OncePerDay = 1;
	
	DayPivot = (highd(0)+lowd(0)+Close) / 3;
	ThreeDHigh = highest(high,(276));
	ThreeDLow = lowest(low,(276));
	SecondNumber = (ThreeDLow + ThreeDHigh) /2;
	PivotDiff = (DayPivot - SecondNumber); 
	ThreeDRangeHigh = (DayPivot + PivotDiff);
	ThreeDRangeLow = (DayPivot - PivotDiff);
	ThreeDPP = (ThreeDLow + ThreeDHigh +c[0]) /3;

	
end; 
 
        plot2(ThreeDRangeHigh,"+3dRangeHigh",DarkGreen); 
	plot3(ThreeDRangeLow,"-3dRangeLow",DarkRed); 
	plot4(ThreeDPP,"3dPP",Blue);

Attached Thumbnails
Click image for larger version

Name:	Wacky_Sunday.png
Views:	143
Size:	157.2 KB
ID:	315420  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Quant vue
Trading Reviews and Vendors
Cheap historycal L1 data for stocks
Stocks and ETFs
ZombieSqueeze
Platforms and Indicators
NexusFi Journal Challenge - May 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
77 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
37 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
17 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

stevemkay,

welcome to futures.io. Nothing in your code prevents the expression "If Time > 1600 and OncePerDay = 0" evaluating to true on Sundays. One idea could be to include a check for the day of the week (using the reserved word DayOfWeek) to ensure the expression is false on Sundays.

Regards,

ABCTG


stevemkay View Post
I have written/ hacked together the following easy language indicator. The closing price is taken at 1600hrs and begins plotting for the next session immediately. I am having trouble with Sunday evenings then Monday sessions with the indicator recalculaing when it shouldnt until Monday at 1600. Please see the attached screenshots. It will make a lot more sense.
 
Code
vars: 
DayPivot(0),
Mid(0), 
ThreeDHigh(0),
ThreeDLow(0),
PivotDiff(0),
ThreeDRangeHigh(0),
ThreeDRangeLow(0),
OncePerDay(0),
ThreeDPP(0),
SecondNumber(0);
 
If date > date[1] then OncePerDay = 0 ;
If Time > 1600 and OncePerDay = 0
then begin

	OncePerDay = 1;
	
	DayPivot = (highd(0)+lowd(0)+Close) / 3;
	ThreeDHigh = highest(high,(276));
	ThreeDLow = lowest(low,(276));
	SecondNumber = (ThreeDLow + ThreeDHigh) /2;
	PivotDiff = (DayPivot - SecondNumber); 
	ThreeDRangeHigh = (DayPivot + PivotDiff);
	ThreeDRangeLow = (DayPivot - PivotDiff);
	ThreeDPP = (ThreeDLow + ThreeDHigh +c[0]) /3;

	
end; 
 
        plot2(ThreeDRangeHigh,"+3dRangeHigh",DarkGreen); 
	plot3(ThreeDRangeLow,"-3dRangeLow",DarkRed); 
	plot4(ThreeDPP,"3dPP",Blue);


Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
stevemkay
greenville, sc
 
Posts: 2 since Jul 2021
Thanks Given: 1
Thanks Received: 0



ABCTG View Post
stevemkay,

welcome to futures.io. Nothing in your code prevents the expression "If Time > 1600 and OncePerDay = 0" evaluating to true on Sundays. One idea could be to include a check for the day of the week (using the reserved word DayOfWeek) to ensure the expression is false on Sundays.

Regards,

ABCTG


Thats what I needed.
Thanks!!!!

Reply With Quote




Last Updated on July 26, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts