Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 04:00:22 +0000



Post From: drawing a marker, issues with repeated drawing

[2024-03-27 09:41:08]
User907968 - Posts: 823
1. Use UTAM_ADD_OR_ADJUST
2. Retain the same linenumber (i.e. via persistentint) during bar formation so that you can edit/adjust intrabar
3. Upon new bar set saved linenumber to -1, so new linenumber is generated automatically by usetool
4. Save newly generated linenumber to persistentint and retain during bar formation
5. Rinse and repeat



auto& r_LineNumber = sc.GetPersistentIntFast(0);
auto& r_LastIndex = sc.GetPersistentIntFast(1);

if (sc.Index != r_LastIndex)
{
r_LineNumber = -1;
r_LastIndex = sc.Index;
}

if(condition)
{

s_UseTool Tool;
Tool.Clear(); // Reset tool structure. Good practice but unnecessary in this case.
Tool.ChartNumber = sc.ChartNumber;
Tool.DrawingType = DRAWING_MARKER;
Tool.LineNumber = r_LineNumber;
Tool.BeginDateTime = sc.BaseDateTimeIn[sc.Index];
Tool.BeginValue = sc.Low[sc.Index]-Shiftmarker;
Tool.Color = RGB(0,128,0);
Tool.AddMethod = UTAM_ADD_OR_ADJUST;
Tool.MarkerType = MARKER_X; //MARKER_TRIANGLEUP;
Tool.MarkerSize = 4;
Tool.LineWidth = 5;

sc.UseTool(Tool);

r_LineNumber = Tool.LineNumber;

}