NexusFi: Find Your Edge


Home Menu

 





Plotting Data Points


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
golb0016
Minneapolis Minnesota
 
Posts: 3 since Jan 2014
Thanks Given: 3
Thanks Received: 0

I'm trying to plot some data generated in an Excel spreadsheet against futures prices. I remove 1000000 from the date because for some reason an extra 1 is added on the front of every date. Then the date is run through a bunch of logic statements to find the data point that matches the date and sets the Diff variable to the value and plotpoint to True. At the end it checks to see if should add a point. Right now I'm only able to get it to either plot no points or the very last point (i.e. 3026). Any suggestions are much appreciated!

Vars: Diff(0), plotpoint(False);

Value1 = date - 1000000;

If Value1= 130108 then Diff= 136497 and plotpoint=True;
If Value1= 130115 then Diff= 140085 and plotpoint=True;
If Value1= 130122 then Diff= 133681 and plotpoint=True;
//More data points here removed for this post
If Value1= 140107 then Diff= 60070 and plotpoint=True;
If Value1= 140114 then Diff= 16131 and plotpoint=True;
If Value1= 140121 then Diff= 3026 and plotpoint=True;

If plotpoint = True then begin
Value2 = Round(Diff/1000,0);
Plot7(Value2,"COT",Red);
Plotpoint = False;
End;


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
Roland Garros Final Day: $3M on Zverev at 80.5% -- Leban …
Prediction Markets & Event Contracts
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
Warsh Rate Hike at 40%, Iran June 15 Expires Tonight at …
Prediction Markets & Event Contracts
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642


golb0016,

your code did not verify for me as with a simple "if...then" statement you can only
execute code statement and you can't combine them with "and".
Changing the "if...then" to "if...then begin...end" makes the code compile and plot more than one data point.

In EasyLanguage date returns a numerical value indicating the closing date of a bar. The date is indicated in the YYYMMdd format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month.
That's why starting with 2000 all date values have the 1 as first number.

Regards,
ABCTG



 
Code
Vars: Diff(0), plotpoint(False);

Value1 = date - 1000000;

If Value1= 130108 then 
begin
	Diff= 136497;
	plotpoint=True;
end
else
If Value1= 130115 then 
begin
	Diff= 140085;
	plotpoint=True;
end
else
If Value1= 130122 then 
begin
	Diff= 133681;
	plotpoint=True;
end
//More data points here removed for this post
else
If Value1= 140107 then 
begin
	Diff= 60070;
	plotpoint=True;
end
else
If Value1= 140114 then 
begin
	Diff= 16131;
	plotpoint=True;
end
else
If Value1= 140121 then
begin
	Diff= 3026;
	plotpoint=True;
end;

If plotpoint = True then begin
Value2 = Round(Diff/1000,0);
Plot7(Value2,"COT",Red);
Plotpoint = False;
End;


Follow me on X Reply With Quote
Thanked by:
  #4 (permalink)
 BobF 
Hyannis, MA
 
Experience: Advanced
Platform: TradeStation
Trading: ES
Posts: 3 since Nov 2011
Thanks Given: 0
Thanks Received: 2

Here is a little simpler solution:

---

Vars: Diff(0), plotpoint(False);

Value1 = date - 1000000;

Diff = -999999;

If Value1= 130108 then Diff= 136497;
If Value1= 130115 then Diff= 140085;
If Value1= 130122 then Diff= 133681;
//More data points here removed for this post
If Value1= 140107 then Diff= 60070;
If Value1= 140114 then Diff= 16131;
If Value1= 140121 then Diff= 3026;

If Diff <> -999999 then begin
Value2 = Round(Diff/1000,0);
Plot7(Value2,"COT",Red);
End;

---

This presets Diff to a weird number (-999999) on each bar then plots only if it is changed from that weird number.


Reply With Quote
Thanked by:




Last Updated on February 17, 2014


© 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