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 3,226 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 1 attachments




 
Search this Thread
  #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:	255
Size:	157.2 KB
ID:	315420  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
EA
Platforms and Indicators
Datafeed for Atas
Platforms and Indicators
Trump Media to sell instant access to market-moving soci …
Traders Hideout
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
No book, only a stair: journaling fills where price move …
Cryptocurrency
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

stevemkay,

welcome to NexusFi. 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 X 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 NexusFi. 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


© 2026 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 - Downloads - Top
no new posts