Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I have an If Then statement with 4 conditions that may occur. When one of the four conditions occur the Then statement plot a vertical trend line with two text statements. The text statements are of the same name. One statement plots the name name of the bar above the high of the bar and one text statement plots the name below the low of the bar on the trend line.The trend line and names plot the first time one of the four conditions is met. However, succeeding times when the condition(s) occur nothing is plotted. I know the conditions are properly identified in the data because the print statement that plots in the debug tab plots the conditions as sought by the code. Thank you in advance for any all help and insight.
Can you help answer these questions from other members on NexusFi?
it's pretty hard to give you a helpful hint without knowing your code. If you post the code I am sure someone is willing to take a look at it. You don't have to reveal your actual logic, but can even replace it with something else. Just leave the trendline part and make sure the new logic suffers from the same issues.
TDR Ingress Line (ShowMe) - Tuesday, September 30, 2014 08:11:46
{*******************************************************************
Description : This Show Me Study draws a line on the chart
********************************************************************}
{Declarations}
Vars: Ingress Line(O);
Vars: Ingress-Date (0);
Vars: Ingress-Month(O);
Vars: Ingress-Day of Week(O);
Vars: Lower Llmit(O);
Vars: Upper-Limit(O);
Vars: Glyph-Lower(-l);
Vars: G1yph=Upper(-I);
{Aasignments}
Ingress Date = @DayofMonth(date);
Ingress-Month = @Month(date);
Ingress-Day_of_Week = @DayofWeek(date);
Lower Limit
Upper=Limit
Low -10;
High + 10;
Ingress falls on a Tuesday, Wednesday, or Thursday, or Friday}
If (Ingress Month = 1 and
Ingress Date = 21 and
(Ingress Day of Week = 2 or
Ingress Day of Week 3 or
Ingress Day-of-Week 4 or
Ingress=Day=of=Week 5)) Or
{Ingress falls on a Monday}
(Ingress_Month = 1 and
Ingress Date = 18 and
Ingress-Day_of_Week = 5 ) or
{Ingress falls on a Saturday}
(Ingress_Month = 1 and
Ingress Date = 20 and
Ingress-Day_of_Week = 5 or
{Ingress falls on a Sunday}
(Ingress_Month = 1 and
Ingress_Date = 19 and
Ingress_Day_of_Week = 5 ) then
Begin
Glyph_Lower = Text New(Date, 1600, (low -3), "CAP "+NumToStr(Year(Date),4) );
Text SetColor(Glyph Lower, White);
Text-SetStyle(Glyph=Lower,2,2) ;
Glyph_Upper = Text New(Date, 1600, (high + 5),"CAP "+NumToStr(Year(Date),4) );
Text SetColor(Glyph Upper, White);
Text-SetStyle(Glyph=Upper,2,2);
What are the @'s supposed to do in your code? Also there are a lot of spaces between variable names, so that the code you provided won't verify let alone even draw a single trendline.
So why are you converting reserved words into functions or what does @DayOfMonth do different than the reserved word DayOfMonth? Also what is "Ingress Date" supposed to do? That's what I meant with spaces between variable names, not the whitespaces in your code.
First of all, please forgive me if what I point out is unimportant as I am not totally familiar with this language but I do notice inconsistencies in your code. I have changed the color of the code to highlight them
these are my observations on your code...maybe those observations don't mean much or maybe they are your problem.
Finally why would you use a dash "-" in your variables.....How can one tell the difference between an subtraction and a character....would not an underscore "_" or simply joining the characters into one word be better??
EDIT: I also note other inconsistencies in the naming of your variables....
Vars: Ingress Line(O); ........ has no dash
Vars: G1yph=Upper(-I); ........ Is this a mathematical function or a variable name also is this a typo should it not be "Glyph" not "G1yph" as I see no reference to to G1yph in the statement
Glyph_Upper = Text New(Date, 1600, (high + 5),"CAP "+NumToStr(Year(Date),4) );
Finally you show no consistent naming of your variables or assignments
(Ingress Day of Week = 2 or
Ingress Day of Week 3 or there is no "=" sign How is your variable to get the value 3
Ingress Day-of-Week 4 or Now you add dashes is this a new variable??? again no equal sign
Ingress=Day=of=Week 5)) now "=" signs added except for the assignment of 5
As I said before...I don't know this script language but as a former debugger of VB code this looks weird to me
You can upload the working ELD here, as this will include the functions then, and I will take a look. The code you posted here won't verify let alone even give one trendline. Maybe something just went wrong with posting it, but there are so many issues in it that I doubt anyone is willing to fix those before getting to helping you with your actual problem.