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



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


Discussion in EasyLanguage Programming

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




Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

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

(login for full post details)
  #1 (permalink)
stevemkay
greenville, sc
 
 
Posts: 2 since Jul 2021
Thanks: 1 given, 0 received

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:	101
Size:	157.2 KB
ID:	315420  
Reply With Quote

Can you help answer these questions
from other members on futures io?
in depth understanding of last, bid, and ask volume in c …
NinjaTrader
How do I create Strategy with the Second Entry indicator
NinjaTrader
Big Mo Indicator for NT8
NinjaTrader
Market on Close data within IB
Platforms and Indicators
Multi Time Frame High/Low/Median levels
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Is anyone actually making money?
88 thanks
An embarrassing, honest confession
25 thanks
ApexTraderFunding.com experience and review
8 thanks
Sierra vs. Ninja : why I chose .....
8 thanks
Want your NinjaTrader indicator created, free?
7 thanks
 
(login for full post details)
  #2 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,361 since Apr 2013
Thanks: 426 given, 1,579 received

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
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #3 (permalink)
stevemkay
greenville, sc
 
 
Posts: 2 since Jul 2021
Thanks: 1 given, 0 received



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


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Having trouble with a futures indicator working incorrectly on Sunday/Monday session


Last Updated on July 26, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2023 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts