NexusFi: Find Your Edge


Home Menu

 





Plotting Data Points


Discussion in EasyLanguage Programming

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




 
Search this Thread

Plotting Data Points

  #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?
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
 
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
Bigger Wins or Fewer Losses?
18 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


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 Twitter 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


© 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