New to Algo Need help for deployment

Hi contacted team for deployment of my pyhton script in live market, however they are unable to extend any support, i need help in complete back testing and live testing and deployment.

Hi @Aryan_Sharma ,

Yes, we can assist with the complete process, including backtesting, live testing, and deployment. To proceed further, let us know your specific requirements and the stage you are currently at, so we can determine the next steps accordingly.

I built a strategy using python, its working ok on dhan cloud, now to back test results on paper trade and thereafter deployment on live, i need help, also contacted customer care team but of no help, pls help further @Tradehull_Imran

Hi @Aryan_Sharma

Could you let us know which stage your algo is currently in and where you want to deploy it? This will help us understand your requirement and for further.

@Tradehull_Imran sir as mentioned earlier, i tested my script on dhan hq cloud and its running smoothly, now i want to test in love mkt initially fot paper trade and then with real money, thus need help how to deply for progressively for paper trade and then real

@Tradehull_Imran sir still waiting for ur response

Hi @Aryan_Sharma ,

1. Google Sheets Logging

Step 1: Create a Google Sheet and add:

Timestamp | Level | Message | Order ID | Symbol | Status

Step 2: Go to Extensions → Apps Script and add:

function doPost(e){var sheet=SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();var data=JSON.parse(e.postData.contents);sheet.appendRow([new Date(),data.level||"",data.message||"",data.order_id||"",data.symbol||"",data.status||""]);return ContentService.createTextOutput(JSON.stringify({status:"success"})).setMimeType(ContentService.MimeType.JSON);}

Step 3: Click Deploy → New deployment → Web app.

Step 4: Set:

  • Execute as: Me
  • Who has access: Anyone

Step 5: Deploy and copy the Web App URL.

Step 6: Use this code in Dhan Cloud:

import requests
response=requests.post("[GOOGLE_APPS_SCRIPT_WEB_APP_URL]",json={"level":"INFO","message":"Order placed","order_id":"[ORDER_ID]","symbol":"[SYMBOL]","status":"SUCCESS"},timeout=10)
print(response.json())

2. Dhan Order Placement

Use this code to place real orders in live trading. Google Sheets logging can be used separately in both live trading and paper trading to track the logs.

Use the following code with your Dhan credentials and order details:

from dhanhq import DhanContext,dhanhq

client_id="[CLIENT_ID]"
access_token="[ACCESS_TOKEN]"

security_id=123
exchange_segment="NSE_FNO"
transaction_type="BUY"
quantity=65
order_type="LIMIT"
product_type="INTRADAY"
price=125.50
trigger_price=0

dhan_context=DhanContext(client_id,access_token)
dhan=dhanhq(dhan_context)

response=dhan.place_order(security_id=security_id,exchange_segment=exchange_segment,transaction_type=transaction_type,quantity=quantity,order_type=order_type,product_type=product_type,price=price,trigger_price=trigger_price)

print(response)

Replace the values with the required details.