39 THStock * parent, std::string opt_string )
42 std::cout <<
"Entry FactoryObjectStock::CreateObjectStock " << std::endl;
46 std::cout <<
"Full_name_indic " << full_name_indic << std::endl;
47 std::cout <<
"size " << size << std::endl;
50 std::cout <<
"opt_string :" << opt_string <<
"!!" << std::endl;
64 std::vector<std::string> obj_color;
67 std::vector<std::string> descp;
69 if ( opt_string.size() > 0 ) {
71 std::cout <<
" An optional opt_string was given " << std::endl;
74 descp.push_back ( opt_string );
76 std::cout <<
"update descp[0] " << descp[0] << std::endl;
81 std::cout <<
"Will call parse description" << std::endl;
88 std::cout <<
"\tPrint Factory, get description of the indicator " << std::endl;
89 std::cout <<
" summary in Factory " << std::endl;
91 for (
unsigned int i = 0; i < descp.size(); i ++ ) {
92 std::cout <<
"descp " << descp[i] << std::endl;
98 if ( descp[0][0] ==
'L' ) {
100 std::cout <<
"case L" << std::endl;
103 if ( descp[0][1] ==
'C' ) {
104 #ifdef DEBUG_OBJSTOCK
105 std::cout <<
" case C for Candle " << std::endl;
109 }
else if ( descp[0][1] ==
'B' ) {
110 #ifdef DEBUG_OBJSTOCK
111 std::cout <<
" case B for Bar " << std::endl;
120 }
else if ( descp[0][0] ==
'P' ) {
121 #ifdef DEBUG_OBJSTOCK
122 std::cout <<
"case P" << std::endl;
124 object =
new PStockLine( full_name_indic, size );
127 #ifdef DEBUG_OBJSTOCK
128 std::cout <<
"get color " << descp[0][2] << std::endl;
133 object->SetLineColor( indic.
MakeEColor( descp[0][2]) );
136 }
else if ( descp[0][0] ==
'K' ) {
137 #ifdef DEBUG_OBJSTOCK
138 std::cout <<
"case K" << std::endl;
144 for (
unsigned int i = 1; i < descp.size(); i++ ) {
149 #ifdef DEBUG_OBJSTOCK
150 std::cout <<
"Call Factory::CreateObject descp[i] " << descp[i] << std::endl;
157 object->AddToVecObject( sub_object );
163 std::cout <<
"descriptor not implemented " << descp[0][0] << std::endl;
170 #ifdef DEBUG_OBJSTOCK
171 std::cout <<
"indic == RSI add ObjectLineIndicator " << std::endl;
186 parent->
Add ( line1 );
187 parent->
Add ( line2 );
204 #ifdef DEBUG_OBJSTOCK
205 std::cout <<
"Exit FactoryObjectStock::CreateObjectStock object" <<
object << std::endl;
206 std::cout <<
"GetSize of new object " <<
object->GetSize() << std::endl;
207 std::cout <<
"Return object ObjectName" <<
object->GetNameObject() << std::endl;
226 #ifdef DEBUG_OBJSTOCK
227 std::cout <<
"\n\tEntry FactoryObjectStock::CreateDrawableObjectLine " << std::endl;
228 std::cout <<
"stage_draw " << stage_draw << std::endl;
229 std::cout <<
"valueX " << valueX <<
" valueY " << valueY << std::endl;
232 #ifdef DEBUG_OBJSTOCK
233 if (
obj !=
nullptr ) {
235 std::cout <<
"obj different of nullptr" << std::endl;
237 std::cout <<
"obj is nullptr " << std::endl;
245 #ifdef DEBUG_OBJSTOCK
246 std::cout <<
"Draw a support or a tendance at stage 1 creation " << std::endl;
252 if (
obj !=
nullptr ) {
256 std::cout <<
"Error in creating ObjectLineTendance, stage begin object null" << std::endl;
263 #ifdef DEBUG_OBJSTOCK
264 std::cout <<
"move a support or a tendance " << std::endl;
266 std::cout <<
"move to " << valueX <<
" " << valueY << std::endl;
277 gVirtualX->DrawLine( gPad->XtoAbsPixel(
obj->
GetX0()),
295 gVirtualX->DrawLine( gPad->XtoAbsPixel(
obj->
GetX0()),
303 }
else if ( stage_draw ==
kEndDraw ) {
304 #ifdef DEBUG_OBJSTOCK
305 std::cout <<
"finalize a support or a tendance " << std::endl;
306 std::cout <<
"get X0 X1 " <<
obj->
GetX0() <<
" " <<
obj->
GetX1() << std::endl;
307 std::cout <<
"get Y0 Y1 " <<
obj->
GetY0() <<
" " <<
obj->
GetY1() << std::endl;
309 std::cout <<
"SetX1/Y1 " << valueX <<
" " << valueY << std::endl;
317 std::cout <<
"Mode is not known, make default behaviour setX1 " << std::endl;
384 if ( str_color ==
'B')
return kBlue;
385 else if ( str_color ==
'R' )
return kRed;
386 else if ( str_color ==
'V' )
return kViolet;
std::vector< std::string > parse_description() const
Utility function to parse the description.
virtual TypeLine GetTypeLine() const
Derive from TH1 will draw the graph.
"Clever" enumeration of the ListDataStock type : StockCSV, Volume, EMA, BOLL,...
static ObjectLine * obj
no direct access to internal ObjectLine
static IndicatorObjectStock * CreateObjectStock(Indicator indic, std::string full_name_indic, unsigned int size, THStock *parent, std::string opt_string=std::string())
create indicator object
virtual void SetParent(THStock *thstock)
virtual void Add(ObjectLine *obj_stock)
call by Factory, specific to drawable line
int MakeEColor(const char str_color)
static Indicator const RSI
double GetX0() const
wrapper functions to fline, need public for all ??
Define a base class for drawing indicator only, they are sorted in ListDataStock object.
Define the template ListObjectStock<T> in a separate header.
static EColor MakeColor(const char str_color)
translate name to integer color in root
static ObjectLine * CreateDrawableObjectLine(int stage_draw, double valueX, double valueY, TypeLine mode_obj)
create specifically ObjectLine
virtual void SetLineColor(Color_t color)
Define a vector for all identical Object ( Candle, Bar...)
Used for free drawing of support/tendance Add a general line description with coeef_d and origin : y ...
std::string GetDescription() const
Graphical description.
TypeLine
c++ 11 style, used by both EditorObjectStock and ObjectLine cannot make dictionary with enum class ! ...
Line for drawing with indicator, eg, RSI 30-70 Could be in Collection or in THStock They are fixed : ...
std::string const label() const
Get the label.