ManpreetWV
-
Posts
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Community Tutorials
Store
Posts posted by ManpreetWV
-
-
Are there any plans to update the rest API to include the data provided by IG on sentiment by the last hour?
On the trading app we get
56% sells in last hour ...
Can we access this data via REST API?
-
Read the manual, i was not using PUT as the method. Very simple fix.
- 1
-
Quote
$headers = array(
'Content-Type: application/json; charset=UTF-8',
'Accept: application/json; charset=UTF-8',
'Version: 2',
'X-IG-API-KEY: '.$xapikey,
'CST: ' .$_SESSION['api_cst'],
'X-SECURITY-TOKEN: '.$_SESSION['api_xtoken']
);
$data = array("stopLevel" => "9300", "limitLevel" => null, "trailingStop" => " false", "trailingStopDistance" => null, "trailingStopIncrement" => null);
$data_string = json_encode($data);
$id="DIAAAAKF225EXAL";
$ch = curl_init('https://demo-api.ig.com/gateway/deal/positions/otc/?' . $id . '');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);$result = curl_exec($ch);
print"$result";above is my code, I get:
{"errorCode":"invalid.request.trailingStopDistance"}
However using the exact same header output and json output it works in the REST API.
why the errror?
Hourly sentiment data via API
in IG Technical Support - Platform and App Help
Posted
Bump , any idea ?