NexusFi: Find Your Edge


Home Menu

 





Incorrect chart drawings caused by timestamps


Discussion in EasyLanguage Programming

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




 
Search this Thread

Incorrect chart drawings caused by timestamps

  #1 (permalink)
tomas262
Ostrava, Czech Republic
 
Posts: 98 since May 2013
Thanks Given: 19
Thanks Received: 38

Hello,

I seek for an advice on how to solve the problem of incorrectly positioned text above/below price bars.

Most of the time text is placed correctly when Close price crosses supertrend line but when there are multiple candles with the same timestamp like 15:28 (and the next one also 15:28) the drawing is placed incorrectly. Seems EasyLanguage cannot distinguish miliseconds part of a candle timestamp

Platform used is OEC Trader

See the screenshot attached

Is there any way to solve this?

Thanks for help

 
Code
// SuperTrend indicator 
inputs: 
ATRLength(3), ATRMult(1), MedLength(2), UpColor(green), DnColor(red); 

variables: 
ATR(0), 
medi(0), 
dn(0), 
up(0), 
trend(1), 
flag(0), 
flagh(0), 
SuperTrend(0), 
downArrow(0),
upArrow(0);

ATR = AvgTrueRange(ATRLength) * ATRMult; 
medi = Median((High+Low)/2, MedLength); 
up = medi + ATR; 
dn = medi - ATR; 

if Close > up[1] then trend = 1 else if Close < dn[1] then trend = -1;

if trend < 0 and trend[1] > 0 then flag=1 else flag=0; 
if trend > 0 and trend[1] < 0 then flagh = 1 else flagh = 0; 

if trend > 0 and dn < dn[1] then dn=dn[1];
if trend < 0 and up > up[1] then up=up[1]; 

if flag = 1 then up = medi + ATR;
if flagh = 1 then dn = medi - ATR; 

if trend = 1 then SuperTrend = dn else SuperTrend = up; 

if flag = 1 then begin
	downArrow = Text_New( Date, Time, High + 300 Point, "S");
	Text_SetColor(downArrow, DnColor);
end;

if flagh = 1 then Begin
	upArrow = Text_New( Date, Time, Low - 300 Point, "B");
	Text_SetColor(upArrow, UpColor);
end;

Plot1(SuperTrend, "SuperTrend");

Attached Thumbnails
Click image for larger version

Name:	2017-11-25_22-04-34.png
Views:	170
Size:	215.1 KB
ID:	243959  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


tomas262,

in Tradestation or Multicharts you have the ability to draw text and draw them at a specific bar number. I am not sure if OEC does support this, as it goes beyond legacy EasyLanguage, but you might want to check if you can accomplish this with C# code within OEC.

Regards,

ABCTG

Follow me on Twitter Reply With Quote




Last Updated on November 27, 2017


© 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