def entry_analyze(fig, data, n):
 data2 = data.sort_index(by='exit_profit')
 data_long = data2[data2['islong']]
 data_short = data2[(data2['islong'] == False)]
 exit_profit = data2['exit_profit']
 entry_best = pd.concat([data_long.high_profit, data_short.low_profit]).reindex(data2.index)
 entry_worst = pd.concat([data_long.low_profit, data_short.high_profit]).reindex(data2.index)
 try:
  entry_nbar_best = data2['entry_nbar_best']
  entry_nbar_worst = data2['entry_nbar_worst']
 except Exception as e:
  entry_nbar_best = []
  entry_nbar_worst = []
 return plot_entry(fig, exit_profit, entry_best, entry_worst, entry_nbar_best, entry_nbar_worst, n)

def entry_analyze ( fig , data , n ) : data2 = data . sort_index ( by = 'exit_profit' ) data_long = data2 [ data2 [ 'islong' ] ] data_short = data2 [ ( data2 [ 'islong' ] == False ) ] exit_profit = data2 [ 'exit_profit' ] entry_best = pd . concat ( [ data_long . high_profit , data_short . low_profit ] ) . reindex ( data2 . index ) entry_worst = pd . concat ( [ data_long . low_profit , data_short . high_profit ] ) . reindex ( data2 . index ) try : entry_nbar_best = data2 [ 'entry_nbar_best' ] entry_nbar_worst = data2 [ 'entry_nbar_worst' ] except Exception as e : entry_nbar_best = [ ] entry_nbar_worst = [ ] return plot_entry ( fig , exit_profit , entry_best , entry_worst , entry_nbar_best , entry_nbar_worst , n )
data: ���� .