NexusFi: Find Your Edge


Home Menu

 





Howto get a DRAWING_HORIZONTALLINE color ?


Discussion in Sierra Chart

Updated
      Top Posters
    1. looks_one bluewave65 with 5 posts (0 thanks)
    2. looks_two yonatan with 4 posts (4 thanks)
    3. looks_3 swandro with 2 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,032 views
    2. thumb_up 4 thanks given
    3. group 3 followers
    1. forum 12 posts
    2. attach_file 0 attachments




 
Search this Thread

Howto get a DRAWING_HORIZONTALLINE color ?

  #1 (permalink)
bluewave65
CZECH REPUBLIC
 
Posts: 24 since Nov 2015
Thanks Given: 1
Thanks Received: 0

Hi,

is there a function in acsil to do that ?

Thanks
Dave

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Futures True Range Report
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
Battlestations: Show us your trading desks!
24 thanks
The Program
17 thanks
  #3 (permalink)
 yonatan 
Haifa Israel
 
Experience: Beginner
Platform: sierra chart
Broker: Optimus Trading Group/Rithmic
Trading: es
Posts: 91 since Apr 2012
Thanks Given: 50
Thanks Received: 71


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
Thanked by:
  #4 (permalink)
bluewave65
CZECH REPUBLIC
 
Posts: 24 since Nov 2015
Thanks Given: 1
Thanks Received: 0

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)
 
LDog's Avatar
 LDog 
Lafayette, TN/USA
 
Experience: Beginner
Platform: SC,TastyWorks,ToS
Broker: TDA, OANDA,AMP/CQG/SC
Trading: Looking for it/them
Posts: 210 since Sep 2015
Thanks Given: 11,904
Thanks Received: 344

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)
 swandro 
England
 
Experience: Advanced
Platform: SierraChart
Posts: 70 since Jul 2009
Thanks Given: 9
Thanks Received: 80

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)
 yonatan 
Haifa Israel
 
Experience: Beginner
Platform: sierra chart
Broker: Optimus Trading Group/Rithmic
Trading: es
Posts: 91 since Apr 2012
Thanks Given: 50
Thanks Received: 71

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)
bluewave65
CZECH REPUBLIC
 
Posts: 24 since Nov 2015
Thanks Given: 1
Thanks Received: 0

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

: DRAWING_HORIZONTALLINE


dave

Reply With Quote
  #9 (permalink)
 yonatan 
Haifa Israel
 
Experience: Beginner
Platform: sierra chart
Broker: Optimus Trading Group/Rithmic
Trading: es
Posts: 91 since Apr 2012
Thanks Given: 50
Thanks Received: 71

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)
 yonatan 
Haifa Israel
 
Experience: Beginner
Platform: sierra chart
Broker: Optimus Trading Group/Rithmic
Trading: es
Posts: 91 since Apr 2012
Thanks Given: 50
Thanks Received: 71


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
Thanked by:




Last Updated on February 15, 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