Learn Advanced Algo Trading Series | Codes | Youtube

Hi @Subhajitpanja, we tried reaching out to your number, but the call went unanswered. Please note that the AMO option becomes visible only after you placed an AMO order. For API users, AMO orders can be placed only after market hours. If you are facing any difficulty in order placement.

We request you to connect with our support team for real-time assistance.

@Tradehull_Imran,
I completed Mastering Algo Series, due to to some issue couldn’t focus on Advanced Algo immediately.
Thank you very much for you guidance.
Starting Advanced Algo series.
Without your blessing, it is incomplete.
Once again thank you sir.

Regards
Nitin

1 Like

Thank you so much @Mohseen_Usmani

Let me check more

@Mohseen_Usmani

Hi @Tradehull_Imran sir, today I observed one strange thing, I would be happy if you help me on this:This was one of the buying/selling condition:

chart          = tsl.get_historical_data(stock_name, “NSE”, “5”)
lcc_chart      = chart.iloc[-2]
bc3            = chart.iloc[-2]['CDLENGULFING'] == 100

In this case I am getting value of true or false in bc3.
But problem in this case is:

chart          = tsl.get_historical_data(stock_name, “NSE”, “5”)
lcc_chart      = chart.iloc[-2]
bc3            = lcc_chart['CDLENGULFING'] == 100

Output:

Traceback (most recent call last):
  File "C:\Users\subud\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\indexes\base.py", line 3653, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas\_libs\index.pyx", line 147, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 176, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 7080, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'CDLENGULFING'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\subud\Dhan Algo\2 Advanced Algo\Session 2\Indicator based Scanner.py", line 47, in <module>
    sc3 = lcc_chart['CDLENGULFING'] == -100
  File "C:\Users\subud\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\series.py", line 1007, in __getitem__
    return self._get_value(key)
  File "C:\Users\subud\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\series.py", line 1116, in _get_value
    loc = self.index.get_loc(label)
  File "C:\Users\subud\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\indexes\base.py", line 3655, in get_loc
    raise KeyError(key) from err
KeyError: 'CDLENGULFING'

For your information line 47 refers to sc3 = lcc_chart[‘CDLENGULFING’] == -100.

Kindly help me on this.
Thank you in advance.

Hi @nitinsubudhi ,

The error occurs because CDLENGULFING is not a column in the DataFrame. Accessing a non-existent column from a row Series will always raise a KeyError.

1 Like