LineNumber / sc.LineExists(), ... - Sierra Chart Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > Sierra Chart > Sierra Chart Programming

LineNumber / sc.LineExists(), ...
Started:June 25th, 2012 (08:04 AM) by funk101 Views / Replies:636 / 2
Last Reply:June 25th, 2012 (09:12 AM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

LineNumber / sc.LineExists(), ...

Old June 25th, 2012, 08:04 AM   #1 (permalink)
Elite Member
Margate, Fl.
Futures Experience: Advanced
Platform: NinjaTrader/R
Favorite Futures: Futures
Posts: 24 since Jun 2009
Thanks: 5 given, 5 received

LineNumber / sc.LineExists(), ...

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)

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?

Reply With Quote

Old June 25th, 2012, 08:04 AM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Old June 25th, 2012, 09:12 AM   #3 (permalink)
Elite Member
Madison, WI
Futures Experience: Advanced
Platform: Sierra Charts, ALT
Favorite Futures: ES
aslan's Avatar
Posts: 613 since Jan 2010
Thanks: 339 given, 1,056 received

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

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > Sierra Chart > Sierra Chart Programming > LineNumber / sc.LineExists(), ...

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using the Perry Method with SC gloveday Sierra Chart 5 February 9th, 2012 05:26 AM
Repost: SC Advantage vs NT Advantages puma Sierra Chart 3 January 4th, 2012 10:57 PM
[Other]       100 volume - NT vs MC vs SC Jonson Platforms and Indicators 6 September 26th, 2011 12:02 PM
Couple of SC (C++) programming questions vegasfoster Sierra Chart Programming 9 July 21st, 2011 04:29 PM
D9 Conversion from NT to SC vegasfoster The Elite Circle 9 March 1st, 2011 09:41 PM

All times are GMT -4. The time now is 04:15 AM.

Copyright © 2016 by 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.
no new posts

Page generated 2016-10-23 in 0.08 seconds with 20 queries on phoenix via your IP