-
Notifications
You must be signed in to change notification settings - Fork 670
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I add signals to my diagram using make_addplot. But if there are no signals in the selected time period, I get an error.
I have solved it for me as follows:
if stock[stock['Signal'].notnull()].shape[0] == 0:
print ("- no Signal")
else:
signal_short = mpf.make_addplot(stock['Signal'] * 0.93,
scatter=True,
markersize=150,
marker='v',
color='red'
)
add_plots.append(signal_short)
Would it not be an option to integrate this directly into the function and, if necessary, only issue a warning?
if data.notnull()].shape[0] == 0:
raise Warning("Empty Dataframe!")
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request