Planning to write a Algo

pratyushbgr
Hi,
I am planning to write an Algo, where I will consider the 5th candle in 15 minute time frame and trade the Breakdown or break out of that candle. I will square off at 3 PM and will give a stop loss of 30 points.

I am new to this. I am planning to keep this running and at a particular time, I want this to be triggered. But, is there a way to get the tokens in the code and do not have to really copy and paste from the address bar.

Appreciate if any code available to get the candle high low and initiate the trade

  • ZI4453
    I think your token part should not be "automated"(as per rules). Your developer should be able to handle ...
  • pratyushbgr
    Hi I did this myself and everything was working well. Now suddenly today I started getting error as below, but I am sure all my API key and everything alright.
    kiteconnect.exceptions.TokenException: Incorrect `api_key` or `access_token`.
  • rakeshr
    @pratyushbgr
    When are you generating access_token?
    Access token are flushed every day around 7:40 AM.So, make sure you generate access token post 7:40 AM on the same trading day and it can be used throughout the day.
  • pratyushbgr
    Hi Rakesh,
    Thanks for your reply. I tried to reset everything and tried generating the Secret Token and Access Token again and again. But the result is same.

    I am sure there is some issue at Kite end. Is there something you can advise.

    As I have 28 days left for expiry, is it possible to delete the App and create a new app.

    thanks,
    Pratyush
  • ZI4453
    did u happen to check the header user agent ? @pratyushbgr
  • rakeshr
    @pratyushbgr
    Can you let us which API request is throwing above error?
    Is order placement API throwing above error?
  • pratyushbgr
    Hi Everyone, I figured out what was the issue, there was a small code problem. Somehow I forgot to generate the access token. Thanks everyone for trying to help.
This discussion has been closed.