NexusFi: Find Your Edge


Home Menu

 





Incorrect chart drawings caused by timestamps


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
tomas262
Ostrava, Czech Republic
 
Posts: 97 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:	278
Size:	215.1 KB
ID:	243959  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
Datafeed for Atas
Platforms and Indicators
EA
Platforms and Indicators
Trump Media to sell instant access to market-moving soci …
Traders Hideout
No book, only a stair: journaling fills where price move …
Cryptocurrency
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643


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 X Reply With Quote




Last Updated on November 27, 2017


© 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