NexusFi: Find Your Edge


Home Menu

 





LineNumber / sc.LineExists(), ...


Discussion in Sierra Chart

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




 
Search this Thread

LineNumber / sc.LineExists(), ...

  #1 (permalink)
 funk101 
Margate, Fl.
 
Experience: Advanced
Platform: SierraCharts
Trading: Futures
Posts: 28 since Jun 2009
Thanks Given: 5
Thanks Received: 5

I'm auto-drawing ellipses, I have:

s_UseTool EllipseTool;
EllipseTool.AddMethod = UTAM_ADD_OR_ADJUST;

and when the tool gets drawn I set:

int uid = rand();
EllipseTool.LineNumber = uid;

The Ellipse drawing starts and then a couple of bars later, when certain parameters are met, I want to "close" the Ellipse.
How do I call *that* particular Ellipse?

I have this, and works about 90%:

if (sc.LineExists(sc.ChartNumber, uid)
{
blah;
}

several "ellipses" are drawn and closed as expected, however one seems to be hanging from the beginning of the chart to the current index. Which leads me to believe the code has missed this particular LineNumber, or something. Which then leads me to believe that I need more control and how to call each generated Ellipse. Any ideas?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Build trailing stop for micro index(s)
Psychology and Money Management
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
36 thanks
NexusFi site changelog and issues/problem reporting
25 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #3 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127


Generally you want to structure your IDs based on what you are trying to do. Using rand() is not the best way to go about it for a number of reasons (though it could work if you have a small number of drawings you are tracking). I usually structure my id using something like this:

int LineID = StudyConst*1000000 + DrawingType*10000 + sc.Index*100 + XYZ;

The above is just an example (modify for your needs). Basically depending what you are trying to do dictates how you want to make the drawing unique and how easy it is to look up again. It really depends how many "active" drawings you have that you need to modify later.

To modify a drawing, you need to save/reuse the id. So in your example, the uid should have been saved to a persist var so you can use it later when you look the drawing up. If you did not save it properly or overwrote it, then your lookup fails and you can not close your original drawing.

Reply With Quote




Last Updated on June 25, 2012


© 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