NexusFi: Find Your Edge


Home Menu

 





Trend Line plots once


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one ABCTG with 4 posts (0 thanks)
    2. looks_two RGButzArchInc with 4 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Underexposed with 1 posts (1 thanks)
    1. trending_up 4,207 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

Trend Line plots once

  #1 (permalink)
RGButzArchInc
Columbus OHio
 
Posts: 10 since Sep 2014
Thanks Given: 0
Thanks Received: 0

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.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
My NQ Trading Journal
12 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


RGButzArchInc,

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.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
  #4 (permalink)
RGButzArchInc
Columbus OHio
 
Posts: 10 since Sep 2014
Thanks Given: 0
Thanks Received: 0

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);

Ingress_Line @TL New(Date, 1600,Lower Limit,Date, O,Upper_Limit);

TL-SetCo1or(Ingress Line,Ye11ow);
TL-SetStyle(Ingress-Line,2) ;
TL=SetSize(Ingress_Line,7);

end;

Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

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.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
  #6 (permalink)
RGButzArchInc
Columbus OHio
 
Posts: 10 since Sep 2014
Thanks Given: 0
Thanks Received: 0

Thd @ signs are indicators that the function is a Easy Language function

The code runs on my computer.

I put the spaces in the post to make the code easily readable.

What the code doesn't does not plot any of the trend lines after the first trend line is plotted on the chart.

Reply With Quote
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

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.

Regards,
ABCTG

 
Code
Ingress Date = @DayofMonth(date);


RGButzArchInc View Post
Thd @ signs are indicators that the function is a Easy Language function

The code runs on my computer.

I put the spaces in the post to make the code easily readable.

What the code doesn't does not plot any of the trend lines after the first trend line is plotted on the chart.


Follow me on Twitter Reply With Quote
  #8 (permalink)
RGButzArchInc
Columbus OHio
 
Posts: 10 since Sep 2014
Thanks Given: 0
Thanks Received: 0

The spaces are where the scan of the code did not recognize a dash or an equal sign, for example.

Reply With Quote
  #9 (permalink)
 Underexposed 
Calgary Alberta/Canada
 
Posts: 934 since Feb 2014

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



RGButzArchInc View Post
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);

Why is there no dash between "Lower" and Limit"
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;


There don't appear to be any assignments here. Should not these statements be

Lower Limit = Low-10; (or rather : Lower-Limit = Low-10;
Upper-Limit = High + 10;


Ingress falls on a Tuesday, Wednesday, or Thursday, or Friday}

It seems to me that {} brackets are to wrap comments...but you are missing the left bracket in that previous line...Is that a problem??? I don't know but it is inconsistent

{Ingress falls on a Tuesday, Wednesday, or Thursday, or Friday}



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

Reply With Quote
  #10 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


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.

Regards,
ABCTG


RGButzArchInc View Post
The spaces are where the scan of the code did not recognize a dash or an equal sign, for example.


Follow me on Twitter Reply With Quote




Last Updated on October 1, 2014


© 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