Login Page - Create Account

Support Board


Date/Time: Thu, 23 Jan 2025 03:34:16 +0000



ACSIL: Reward/Risk Tool

View Count: 1438

[2018-10-29 15:25:51]
User185376 - Posts: 1
Dear SC-SupportTeam,

I use the Reward/Risk Tool with my own ACSIL study. Therefore I use almost the same code you provided in the Studies.cpp. The tool is added just fine, but the option "ShowTickDifference = 1" will not be evaluated by SC. When I configurate the ACSIL drawn tool and add the ShowTickDifference option by myself via Chart Drawing Properties, it works.

How can I add the ShowTickDifference flag automatically by ACSIL?

Best regards,
Matthias


s_UseTool Tool;
Tool.Clear();

//Tool.ChartNumber = sc.ChartNumber;
Tool.AddAsUserDrawnDrawing = 1;
Tool.DrawingType = DRAWING_REWARD_RISK;

Tool.BeginIndex = sc.Index; // Stop
Tool.BeginValue = sc.GetLowest(sc.BaseDataIn[SC_LOW], 2)-1*sc.TickSize;
        
Tool.EndIndex = sc.Index+1; // Entry
Tool.EndValue = sc.Close[sc.Index];
        
Tool.ThirdIndex = sc.Index+5; // Target
Tool.ThirdValue = sc.Close[sc.Index]+5*sc.TickSize;

Tool.Color = COLOR_WHITE;        // text color
Tool.TransparentLabelBackground = 0;  // opaque labels
Tool.TextAlignment = DT_RIGHT;      // text alignment (target marker is left/right of text)
Tool.ShowTickDifference = 1;      // text options
Tool.ShowPriceDifference = 0;
Tool.ShowCurrencyValue = 0;
Tool.FontFace = sc.GetChartTextFontFaceName();  // override chart drawing text font
Tool.FontSize = 14;
Tool.FontBold = 1;
        
Tool.LevelColor[0] = RGB(192,192,192);      // stop to entry line
Tool.LevelStyle[0] = LINESTYLE_DASH;
Tool.LevelWidth[0] = 2;

Tool.LevelColor[1] = RGB(192,192,192);      // entry to target line
Tool.LevelStyle[1] = LINESTYLE_DASH;
Tool.LevelWidth[1] = 2;

Tool.LevelColor[2] = COLOR_WHITE;      // entry marker
Tool.LevelStyle[2] = MARKER_DASH;      // marker type
Tool.RetracementLevels[2] = 5;        // marker size
Tool.LevelWidth[2] = 2;          // marker width

Tool.LevelColor[3] = COLOR_RED;        // stop marker
Tool.LevelStyle[3] = MARKER_DASH;      // marker type
Tool.RetracementLevels[3] = 10;        // marker size
Tool.LevelWidth[3] = 2;          // marker width

Tool.LevelColor[4] = COLOR_GREEN;      // target marker
Tool.LevelStyle[4] = MARKER_POINT;      // marker type
Tool.RetracementLevels[4] = 5;        // marker size
Tool.LevelWidth[4] = 2;          // marker width
        
Tool.Region = 0;
Tool.AddMethod = UTAM_ADD_OR_ADJUST;
sc.UseTool(Tool);

[2018-10-29 19:37:40]
Sierra Chart Engineering - Posts: 104368
We will make sure these all of these apply to that particular drawing tool type:
Tool.ShowTickDifference = 1; // text options
Tool.ShowPriceDifference = 0;
Tool.ShowCurrencyValue = 0;
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account