Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. Ved
    3. Posts
    V
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by Ved

    • 75 minutes candle

      Hi,
      I found 75 minutes candle in angelone app. Can any tell me how to get 75 minutes historical candle data.

      posted in General Discussion
      V
      Ved
    • RE: Invalid Token Error

      same issue for me.
      Status : 200{"success":false,"message":"Invalid Token","errorCode":"AG8001","data":""}

      posted in Python SDK
      V
      Ved
    • RE: how to get LTP for USDINR and BANKNIFTY

      @Mnagesh
      I can't find USDINR token code. Can you share me USDINR token code?
      eg.
      BANKNIFTY : 26009
      NIFTY : 26000
      USDINR : ?
      <-- my code -->
      $data["clientcode"] = "client id";
      $data["exchange"] ="CDS";
      $data["tradingsymbol"] ="USDINR";
      $data["symboltoken"]= ? ;
      $url = 'https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/getLtpData';
      $jsonData = json_encode($data);
      $curl = curl_init();
      curl_setopt($curl, CURLOPT_URL, $url);
      curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonData);
      curl_setopt($curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $tradeheaders);

      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

      $result = curl_exec($curl);
      $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

      echo '<br/>Response Status : ' . $http_status;
      echo '<br/>Response String : ' . $result;

      //To Convert json response to array
      $resJsonArray = json_decode($result, true);
      $mms = $resJsonArray['message'];
      echo " mms ".$mms;
      echo "<br><br>";
      $ltp = $resJsonArray['data']['ltp']; echo "<br>ltp".$ltp;

      posted in General Discussion
      V
      Ved
    • how to get LTP for USDINR and BANKNIFTY

      how to get market price for USDINR and BANKNIFTY

      posted in General Discussion
      V
      Ved
    • Currency trading possible

      Currency trading possible or not using api. If yes please refrence for currency api.

      posted in General Discussion
      V
      Ved
    • how to close open position

      I open a buy position on 100 now price is 102 So I want to close open position.
      Please tell me how close my active position using api.
      what parameters required for this.

      posted in General Discussion
      V
      Ved
    • how to get SBIN stock ASK price and BID price in php

      how to get SBIN stock ASK price and BID price in php

      posted in General Discussion
      V
      Ved
    • can I fetch all type data

      Can I fetch all type data from single API ( trade API ). I mean can I fetch historical data , market data and portfolio data using Trade API .
      If YES its great for me.
      If NO. please update your api system and save your and users access limit.
      I think due to login in three API in one query I receive message l
      receive "{"message":"Something Went Wrong, Please Try After Sometime","errorcode":"AB1004","status":false,"data":null}"

      posted in General Discussion
      V
      Ved
    • real fund and ask bid

      I want to fetch ask and bid . can you tell me how can possible fetch ask and bid.

      posted in General Discussion
      V
      Ved
    • RE: I want fetch specific holding

      @webseos i have 3 stock ( BHEL-EQ, SBIN-EQ,NHPC-EQ) in holding. now I want to fetch only BHEL-EQ stock quantity and average price from the exchange using api.

      posted in General Discussion
      V
      Ved
    • I want fetch specific holding

      I have more 3 stock in my demat account . I want get data only BHEL-EQ holding data . Anyone tell me how to fetch only one data
      I use this code :
      <?php
      $urlholding ='https://apiconnect.angelbroking.com/rest/secure/angelbroking/portfolio/v1/getHolding?tradingSymbol=BHEL-EQ';
      $curltrade = curl_init();
      curl_setopt($curltrade, CURLOPT_URL, $urlholding);

      curl_setopt($curltrade, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
      curl_setopt($curltrade, CURLOPT_HTTPHEADER, $tradeheaders);

      curl_setopt($curltrade, CURLOPT_RETURNTRANSFER, 1);

      $resulttrade = curl_exec($curltrade);
      $http_statustrade = curl_getinfo($curltrade, CURLINFO_HTTP_CODE);

      echo '<br/>Response Status trade : ' . $http_statustrade;
      //echo '<br/>Response String trade : ' . $resulttrade;

      //To Convert json response to array
      $resJsontrade = json_decode($resulttrade, true);

      //holding
      $ts = $resJsontrade['data']['0']['tradingsymbol'];
      $exg = $resJsontrade['data']['0']['exchange'];
      $quh = $resJsontrade['data']['0']['quantity'];
      $proh = $resJsontrade['data']['0']['product'];
      $avh = $resJsontrade['data']['0']['averageprice'];
      $ltp0 = $resJsontrade['data']['0']['ltp'];
      $sth = $resJsontrade['data']['0']['symboltoken'];
      $close0 = $resJsontrade['data']['0']['close'];
      $realisedquantity0 = $resJsontrade['data']['0']['realisedquantity'];
      $profitandloss0 = $resJsontrade['data']['0']['profitandloss'];
      echo " ts " . $ts . " quantity " . $quh;
      ?>

      posted in General Discussion
      V
      Ved
    • Without POA possible buy/sell order placement

      Without POA possible buy/sell order placement using API for equity.

      posted in General Discussion
      V
      Ved
    • RE: sell order not posted

      @admin I have htmedia-eq in my demat . Now I want post sell order for delivery .
      $data["exchange"] = "NSE";
      $data["tradingsymbol"] = "HTMEDIA-EQ";
      $data["symboltoken"] = "11979";
      $data["transactiontype"] = "SELL";
      $data["ordertype"] = "LIMIT";
      $data["price"] = "40.0";
      $data["quantity"] = "1";
      $data["disclosedquantity"] = "0";
      $data["variety"] = "NORMAL";
      $data["producttype"] = "DELIVERY";

      posted in General Discussion
      V
      Ved
    • RE: sell order not posted

      @admin I am try again and again but order not posted on exchange.
      Are you write me what requirment for posting order on exchange using your API?

      posted in General Discussion
      V
      Ved
    • RE: sell order not posted

      @admin this is my code :

      <?php
      include "connect.php";
      $jwtselect = mysqli_fetch_assoc(mysqli_query($connection,"select * from token where id ='1'"));
      $feedjwt = $jwtselect['feed'];
      $tradejwt = $jwtselect['trade'];
      $historyjwt = $jwtselect['history'];
      $au="Authorization:Bearer ";
      $feedjwtt = "Authorization:Bearer "." ".$feedjwt;

      $feedheaders = array('Authorization:Bearer '.$feedjwt,'Content-Type: application/json', 'Accept: application/json', 'X-UserType: USER', 'X-SourceID: WEB', 'X-ClientLocalIP: 208.91.198.55', 'X-ClientPublicIP: 43.225.3.40', 'X-MACAddress: 20-E6-17-07-19-3F', 'X-PrivateKey: secretkey');
      $tradeheaders = array('Authorization:Bearer '.$tradejwt,'Content-Type: application/json', 'Accept: application/json', 'X-UserType: USER', 'X-SourceID: WEB', 'X-ClientLocalIP: 208.91.198.55', 'X-ClientPublicIP: 43.225.3.40', 'X-MACAddress: 20-E6-17-07-19-3F', 'X-PrivateKey: secretkey');
      $historyheaders = array($historyjwt,'Content-Type: application/json', 'Accept: application/json', 'X-UserType: USER', 'X-SourceID: WEB', 'X-ClientLocalIP: 208.91.198.55', 'X-ClientPublicIP: 43.225.3.40', 'X-MACAddress: 20-E6-17-07-19-3F', 'X-PrivateKey: secretkey');

      $data["exchange"] = "NSE";
      $data["tradingsymbol"] = "HTMEDIA-EQ";
      $data["symboltoken"] = "11979";
      $data["transactiontype"] = "SELL";
      $data["ordertype"] = "LIMIT";
      $data["price"] = "40.0";
      $data["quantity"] = "1";
      $data["disclosedquantity"] = "0";
      $data["variety"] = "NORMAL";
      $data["producttype"] = "DELIVERY";
      $data["duration"] = "DAY";

      $url = 'https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/placeOrder';

      $jsonData = json_encode($data);

      $curl = curl_init();
      curl_setopt($curl, CURLOPT_URL, $url);

      curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonData);
      curl_setopt($curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $tradeheaders);

      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

      $result = curl_exec($curl);
      $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

      echo '<br/>Response Status : ' . $http_status;
      echo '<br/>Response String : ' . $result;

      //To Convert json response to array
      //$resJsonArray = json_decode($responseContent, true);
      $resJsonArray = json_decode($result, true);
      $mms = $resJsonArray['message'];
      echo " mms ".$mms;
      print_r($result);

      ?>

      posted in General Discussion
      V
      Ved
    • RE: sell order not posted

      @admin I want just know why are not post sell order on exchange. if my query run successfully and I recieved orderid .
      Response String : {"status":true,"message":"SUCCESS","errorcode":"","data":{"script":"HTMEDIA-EQ","orderid":"210525000542903"}}

      please write if my code work good why not post order on exchange. how to post sell order on exchange.

      posted in General Discussion
      V
      Ved
    • sell order not posted

      I try to post sell order in LIMIT. After run my code I recieved output
      " Response Status : 200
      Response String : {"status":true,"message":"SUCCESS","errorcode":"","data":{"script":"HTMEDIA-EQ","orderid":"210525000542903"}} mms SUCCESS{"status":true,"message":"SUCCESS","errorcode":"","data":{"script":"HTMEDIA-EQ","orderid":"210525000542903"}} "

      but sell order not posted on exchange.
      Please write what wrong on my or your end.
      I am using php curl for coding.

      posted in General Discussion
      V
      Ved
    • RE: How to get historical data in json format

      How to convert historical data in json format in php

      posted in General Discussion
      V
      Ved
    • How to get historical data in json format

      I want to create 50 ma so I try to fetch historical data but data not in json format. Please guide to change this data in json format in php.
      i want define
      $resJsonArray = json_decode($result, true);
      $close = $resJsonArray['close']; or $close = $resJsonArray['data'['1'];
      echo " close " . $close;
      Historical data output :
      2021-03-31T09:15:00+05:30,360.30,360.30,357.95,358.80,467553\n2021-03-31T09:16:00+05:30,359.00,359.60,358.45,359.55,293184\n2021-03-31T09:17:00+05:30,359.45,361.10,359.40,360.90,479857\n2021-03-31T09:18:00+05:30,360.80,361.70,360.60,361.45,274692\n2021-03-31T09:19:00+05:30,361.45,361.60,361.00,361.40,169441\n2021-03-31T09:20:00+05:30,361.40,361.40,360.80,361.40,162105\n2021-03-31T09:21:00+05:30,361.30,361.45,360.90,360.95,98352\n2021-03-31T09:22:00+05:30,361.00,361.00,360.50,360.95,133202\n2021-03-31T09:23:00+05:30,361.05,362.00,360.85,361.70,280737\n2021-03-31T09:24:00+05:30,361.85,361.95,361.35,361.70,89110\n2021-03-31T09:25:00+05:30,361.80,362.00,361.55,361.75,148871\n2021-03-31T09:26:00+05:30,361.85,361.85,361.25,361.40,86010\n2021-03-31T09:27:00+05:30,361.40,361.50,361.20,361.25,60152\n2021-03-31T09:28:00+05:30,361.25,361.35,360.20,360.20,266024\n2021-03-31T09:29:00+05:30,360.15,360.30,359.80,359.95,201918\n2021-03-31T09:30:00+05:30,360.00,360.50,359.95,360.50,87527

      posted in General Discussion
      V
      Ved
    • RE: How to login and Generate jwt Token

      Thanks for help I logged now . my write code are ```

      <?php
      //$headers = array('Content-Type: application/json', 'Accept: application/json', 'X-UserType: USER', 'X-SourceID: WEB', 'X-ClientLocalIP: Your_Local_IPAddress', 'X-ClientPublicIP: Your_Public_IPAddress', 'X-MACAddress: Your_MAC_Address', 'X-PrivateKey: Your_Private_Key');
      	    
      $data["clientcode"] = "MY_USERNAME"; 
      $data["password"] = "MY_PASSWORD";
      
      $url = 'https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword';
      
      $jsonData = json_encode($data);
      
      $curl = curl_init();
      curl_setopt($curl, CURLOPT_URL, $url);
      
      curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonData);
      curl_setopt($curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
      
      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
          
      $result = curl_exec($curl);
      $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
      
      echo '<br/>Response Status : ' . $http_status;
      echo '<br/>Response String : ' . $result;
      
      //To Convert json response to array
      $resJsonArray = json_decode($responseContent, true);
      print_r($result);
      ?>
      
      
      posted in General Discussion
      V
      Ved