@@ -355,58 +355,73 @@ def _valid_renko_kwargs():
355
355
'''
356
356
Construct and return the "valid renko kwargs table" for the mplfinance.plot(type='renko')
357
357
function. A valid kwargs table is a `dict` of `dict`s. The keys of the outer dict are
358
- the valid key-words for the function. The value for each key is a dict containing 2
359
- specific keys: "Default", and "Validator" with the following values:
358
+ the valid key-words for the function. The value for each key is a dict containing 3
359
+ specific keys: "Default", "Description" and "Validator" with the following values:
360
360
"Default" - The default value for the kwarg if none is specified.
361
+ "Description" - The description for the kwarg.
361
362
"Validator" - A function that takes the caller specified value for the kwarg,
362
363
and validates that it is the correct type, and (for kwargs with
363
364
a limited set of allowed values) may also validate that the
364
365
kwarg value is one of the allowed values.
365
366
'''
366
367
vkwargs = {
367
368
'brick_size' : { 'Default' : 'atr' ,
368
- 'Validator' : lambda value : isinstance (value ,(float ,int )) or value == 'atr' },
369
+ 'Description' : '' ,
370
+ 'Validator' : lambda value : isinstance (value ,(float ,int ))
371
+ or value == 'atr' },
369
372
'atr_length' : { 'Default' : 14 ,
370
- 'Validator' : lambda value : isinstance (value ,int ) or value == 'total' },
373
+ 'Description' : '' ,
374
+ 'Validator' : lambda value : isinstance (value ,int )
375
+ or value == 'total' },
371
376
}
372
377
373
378
_validate_vkwargs_dict (vkwargs )
374
379
375
380
return vkwargs
376
381
382
+
377
383
def _valid_pnf_kwargs ():
378
384
'''
379
385
Construct and return the "valid pnf kwargs table" for the mplfinance.plot(type='pnf')
380
386
function. A valid kwargs table is a `dict` of `dict`s. The keys of the outer dict are
381
- the valid key-words for the function. The value for each key is a dict containing 2
382
- specific keys: "Default", and "Validator" with the following values:
387
+ the valid key-words for the function. The value for each key is a dict containing 3
388
+ specific keys: "Default", "Description" and "Validator" with the following values:
383
389
"Default" - The default value for the kwarg if none is specified.
390
+ "Description" - The description for the kwarg.
384
391
"Validator" - A function that takes the caller specified value for the kwarg,
385
392
and validates that it is the correct type, and (for kwargs with
386
393
a limited set of allowed values) may also validate that the
387
394
kwarg value is one of the allowed values.
388
395
'''
389
396
vkwargs = {
390
397
'box_size' : { 'Default' : 'atr' ,
391
- 'Validator' : lambda value : isinstance (value ,(float ,int )) or value == 'atr' },
398
+ 'Description' : '' ,
399
+ 'Validator' : lambda value : isinstance (value ,(float ,int ))
400
+ or value == 'atr' },
392
401
'atr_length' : { 'Default' : 14 ,
393
- 'Validator' : lambda value : isinstance (value ,int ) or value == 'total' },
402
+ 'Description' : '' ,
403
+ 'Validator' : lambda value : isinstance (value ,int )
404
+ or value == 'total' },
405
+
394
406
'reversal' : { 'Default' : 1 ,
395
- 'Validator' : lambda value : isinstance (value ,int ) }
407
+ 'Description' : '' ,
408
+ 'Validator' : lambda value : isinstance (value ,int ) },
396
409
}
397
410
398
411
_validate_vkwargs_dict (vkwargs )
399
412
400
413
return vkwargs
401
414
415
+
402
416
def _valid_lines_kwargs ():
403
417
'''
404
418
Construct and return the "valid lines (hlines,vlines,alines,tlines) kwargs table"
405
419
for the mplfinance.plot() `[h|v|a|t]lines=` kwarg functions.
406
420
A valid kwargs table is a `dict` of `dict`s. The keys of the outer dict are
407
- the valid key-words for the function. The value for each key is a dict containing 2
408
- specific keys: "Default", and "Validator" with the following values:
421
+ the valid key-words for the function. The value for each key is a dict containing 3
422
+ specific keys: "Default", "Description" and "Validator" with the following values:
409
423
"Default" - The default value for the kwarg if none is specified.
424
+ "Description" - The description for the kwarg.
410
425
"Validator" - A function that takes the caller specified value for the kwarg,
411
426
and validates that it is the correct type, and (for kwargs with
412
427
a limited set of allowed values) may also validate that the
@@ -415,32 +430,53 @@ def _valid_lines_kwargs():
415
430
valid_linestyles = ['-' ,'solid' ,'--' ,'dashed' ,'-.' ,'dashdot' ,':' ,'dotted' ,None ,' ' ,'' ]
416
431
vkwargs = {
417
432
'hlines' : { 'Default' : None ,
433
+ 'Description' : '' ,
418
434
'Validator' : _bypass_kwarg_validation },
435
+
419
436
'vlines' : { 'Default' : None ,
437
+ 'Description' : '' ,
420
438
'Validator' : _bypass_kwarg_validation },
439
+
421
440
'alines' : { 'Default' : None ,
441
+ 'Description' : '' ,
422
442
'Validator' : _bypass_kwarg_validation },
443
+
423
444
'tlines' : { 'Default' : None ,
445
+ 'Description' : '' ,
424
446
'Validator' : _bypass_kwarg_validation },
447
+
425
448
'colors' : { 'Default' : None ,
426
- 'Validator' : lambda value : value is None or
427
- mcolors .is_color_like (value ) or
428
- ( isinstance (value ,(list ,tuple )) and
429
- all ([mcolors .is_color_like (v ) for v in value ]) ) },
449
+ 'Description' : '' ,
450
+ 'Validator' : lambda value : value is None
451
+ or mcolors .is_color_like (value )
452
+ or (isinstance (value ,(list ,tuple ))
453
+ and all ([mcolors .is_color_like (v ) for v in value ]) ) },
454
+
430
455
'linestyle' : { 'Default' : '-' ,
431
- 'Validator' : lambda value : value is None or value in valid_linestyles },
456
+ 'Description' : '' ,
457
+ 'Validator' : lambda value : value is None
458
+ or value in valid_linestyles },
459
+
432
460
'linewidths' : { 'Default' : None ,
433
- 'Validator' : lambda value : value is None or
434
- isinstance (value ,(float ,int )) or
435
- all ([isinstance (v ,(float ,int )) for v in value ]) },
461
+ 'Description' : '' ,
462
+ 'Validator' : lambda value : value is None
463
+ or isinstance (value ,(float ,int ))
464
+ or all ([isinstance (v ,(float ,int )) for v in value ]) },
465
+
436
466
'alpha' : { 'Default' : 1.0 ,
467
+ 'Description' : '' ,
437
468
'Validator' : lambda value : isinstance (value ,(float ,int )) },
438
469
439
- 'tline_use' : { 'Default' : 'close' ,
440
- 'Validator' : lambda value : isinstance (value ,str ) or (isinstance (value ,(list ,tuple )) and
441
- all ([isinstance (v ,str ) for v in value ]) ) },
442
- 'tline_method' : { 'Default' : 'point-to-point' ,
443
- 'Validator' : lambda value : value in ['point-to-point' ,'least-squares' ] }
470
+
471
+ 'tline_use' : { 'Default' : 'close' ,
472
+ 'Description' : '' ,
473
+ 'Validator' : lambda value : isinstance (value ,str )
474
+ or (isinstance (value ,(list ,tuple ))
475
+ and all ([isinstance (v ,str ) for v in value ]) ) },
476
+
477
+ 'tline_method' : { 'Default' : 'point-to-point' ,
478
+ 'Description' : '' ,
479
+ 'Validator' : lambda value : value in ['point-to-point' ,'least-squares' ] }
444
480
}
445
481
446
482
_validate_vkwargs_dict (vkwargs )
0 commit comments