Howto get a DRAWING_HORIZONTALLINE color ? - Sierra Chart Programming | futures.io
futures.io futures trading


Howto get a DRAWING_HORIZONTALLINE color ?
Started: by bluewave65 Views / Replies:212 / 11
Last Reply: Attachments:0

Welcome to futures.io.

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

Reply
 
Thread Tools Search this Thread
 

Howto get a DRAWING_HORIZONTALLINE color ?

  #1 (permalink)
Trading Apprentice
CZECH REPUBLIC
 
Futures Experience: Advanced
Platform: SIERRACHART
Broker/Data: AMP + CQG
Favorite Futures: US Indexes
 
Posts: 8 since Nov 2015
Thanks: 0 given, 0 received

Howto get a DRAWING_HORIZONTALLINE color ?

Hi,

is there a function in acsil to do that ?

Thanks
Dave

Reply With Quote
 
  #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.

 
  #3 (permalink)
Elite Member
Haifa Israel
 
Futures Experience: Beginner
Platform: sierra chart
Broker/Data: Optimus Trading Group/Rithmic
Favorite Futures: es
 
Posts: 84 since Apr 2012
Thanks: 47 given, 60 received


Using Drawing Tools from an Advanced Custom Study - Sierra Chart
Using Drawing Tools from an Advanced Custom Study - Sierra Chart

example:

s_UseTool CustomToolName;
CustomToolName.Clear();
CustomToolName.AddAsUserDrawnDrawing = 1;
CustomToolName.ChartNumber = sc.ChartNumber;
CustomvName.DrawingType = DRAWING_HORIZONTALLINE;
CustomToolName.Color = //RGB Code or referfernce to a Subgraph's Color
CustomToolName.Width = //Integer or referfernce to a Subgraph's width
CustomToolName.BeginValue = sc.Close[sc.Indec];
sc.UseTool(CustomToolName);

Reply With Quote
The following 2 users say Thank You to yonatan for this post:
 
  #4 (permalink)
Trading Apprentice
CZECH REPUBLIC
 
Futures Experience: Advanced
Platform: SIERRACHART
Broker/Data: AMP + CQG
Favorite Futures: US Indexes
 
Posts: 8 since Nov 2015
Thanks: 0 given, 0 received

Thanks , but .


I don`t need a help for specify color for draw, but find-out which color was user by user by acsil .....

Reply With Quote
 
  #5 (permalink)
Determined
Lexington KY/USA
 
Futures Experience: Beginner
Platform: Sierra Chart,ToS
Broker/Data: TDA, OANDA,AMP/CQG
Favorite Futures: Looking for it/them
 
LDog's Avatar
 
Posts: 85 since Sep 2015
Thanks: 2,214 given, 100 received

Futures Edge on FIO

Which products do you trade?

 
I haven't used the drawing tools, but it may not be possible:
https://www.sierrachart.com/SupportBoard.php?ThreadID=5069

@ejtrader - did you ever find a way to do this?

Reply With Quote
 
  #6 (permalink)
Elite Member
England
 
Futures Experience: Advanced
Platform: SierraChart
 
Posts: 56 since Jul 2009
Thanks: 4 given, 55 received

I am sure there is a simple answer but I do not fully understand what you are trying to do. If you can ask your question differently, maybe I or someone else might be able to help.

Are you looking at some Acsil code or a line drawn by a study? Not sure.

Reply With Quote
 
  #7 (permalink)
Elite Member
Haifa Israel
 
Futures Experience: Beginner
Platform: sierra chart
Broker/Data: Optimus Trading Group/Rithmic
Favorite Futures: es
 
Posts: 84 since Apr 2012
Thanks: 47 given, 60 received

You can loop through all the Horizontal Lines that are on the chart and assign their values to a variable.

s_UseTool HorLine;
int i = 0;
While(sc.GetChartDrawing(0, DRAWING_HORIZONTALLINE, HorLine, i)){
int HorLineColor = HorLine.Color;
i++;
}
This example assigns the RGB color of each Horizontal Line on the chart to the integer HorLineColor .
At the end of the loop HorLineColor will hold the color value of the Horizolntal Line that was ldrawn last.
Not sure about the specifics of converting RGB (###,###,###) to an integer.

Reply With Quote
 
  #8 (permalink)
Trading Apprentice
CZECH REPUBLIC
 
Futures Experience: Advanced
Platform: SIERRACHART
Broker/Data: AMP + CQG
Favorite Futures: US Indexes
 
Posts: 8 since Nov 2015
Thanks: 0 given, 0 received

I need code or function ( if exist ) for get ( not SET ! ) color for each user line previously drawed by user`s ..

: DRAWING_HORIZONTALLINE


dave


Last edited by bluewave65; January 8th, 2017 at 04:48 AM.
Reply With Quote
 
  #9 (permalink)
Elite Member
Haifa Israel
 
Futures Experience: Beginner
Platform: sierra chart
Broker/Data: Optimus Trading Group/Rithmic
Favorite Futures: es
 
Posts: 84 since Apr 2012
Thanks: 47 given, 60 received

The code I gave you above (#7) does exactly that. But I just notices that the sc.GetChartDrawing() function was replaced with sc.GetUserDrawnChartDrawing()
Of course you will have to embed those lines into a full SC study code. Do you know how to do that?
Do you need the colors of the lines for programming purposes or you just want to know the colors ?

Reply With Quote
 
  #10 (permalink)
Elite Member
Haifa Israel
 
Futures Experience: Beginner
Platform: sierra chart
Broker/Data: Optimus Trading Group/Rithmic
Favorite Futures: es
 
Posts: 84 since Apr 2012
Thanks: 47 given, 60 received


Here is an example of a full code for a study that will write to the Message Log the color of every new Horizontal line that is manually added to the chart.

#include <windows.h>
#include "sierrachart.h"
//#include "..\..\ACS_Source\sierrachart.h"

SCDLLName("GetToolColor")

SCSFExport scsf_GetToolColor(SCStudyInterfaceRef sc)
{


if (sc.SetDefaults)
{
sc.GraphName = "GetToolColor";

sc.FreeDLL = 1;

sc.AutoLoop = 0; //Automatic looping is enabled.

return;
}

int& Previousi = sc.GetPersistentInt(1);
s_UseTool HorLine;
int i = 0;
while(sc.GetUserDrawnChartDrawing(0, DRAWING_HORIZONTALLINE, HorLine, i)){
unsigned int HorLineColor = HorLine.Color;
i++;
if(Previousi < i){
SCString str;
str.Format("HorLineColor = %i",HorLineColor);
sc.AddMessageToLog(str, 0);
}
}
Previousi = i;
}

Reply With Quote
The following user says Thank You to yonatan for this post:

Reply



futures.io > > > > > Howto get a DRAWING_HORIZONTALLINE color ?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Anthony Drager: Pulling the trigger with confidence

Elite only
 

Leo Murphy: The Art and Science of Technical Analysis

Elite only
 

FuturesTrader71: Ask Me Anything

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
color zone mgregor Traders Hideout 2 August 10th, 2016 09:21 PM
ZeroLagHMA with color??? bugsbunny NinjaTrader Programming 11 July 20th, 2016 07:22 PM
background color in watchlist lexion ThinkOrSwim 0 December 14th, 2014 01:36 PM
Sierra Chart TPO RTH color ETH color GaryD Sierra Chart 2 April 26th, 2013 05:02 AM
Background color neilzep NinjaTrader 4 May 17th, 2011 11:58 PM


All times are GMT -4. The time now is 06:45 AM.

no new posts
Page generated 2017-01-23 in 0.14 seconds with 19 queries on phoenix via your IP 174.129.78.73