-
Posts
421 -
Joined
-
Last visited
-
Days Won
26
Content Type
Profiles
Forums
Blogs
Events
Community Tutorials
Store
Posts posted by jlz
-
-
7 hours ago, TommyT said:
Not sure what “Accept” is doing.
The Accept header is just to force the server to send you a specific format, a json format in this case.
It is sent as a header because many servers would use xmls as the standard if nothing is specified.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept
- 1
-
I have changed the type to .net standard 2.0. That should let you load it with both 4.5 and .net core. Pull the latest and rebuild the project.
If you have any other issues with the library please log an issue on Github, I don't get notifications from this forum if I don't log in. Github will send me an email with your issue.
-
Hi, that sounds like you could use the trailing stop option.
Edit: I haven't read your last sentence where you note that you might not use it in some cases.
-
Hi, it does work fine.
I left the example at:
https://github.com/AnAlgoTrader/IG.Csharp.Api.Client/blob/master/Playground/Program.cs
-
Hi, the Lightstreamer endpoint comes as part of the authentication response.
For my demo account is: https://demo-apd.marketdatasystems.com
-
Hi, the .net example is far from ideal. I ended developing my own library. An example of how to use the LightStreamer client with it is at:
https://github.com/AnAlgoTrader/IG.Csharp.Api.Client/issues/2
It does not use the DotNetClient_N2.dll where the main problem seems to be at.
-
4 hours ago, igungho said:
It is normal to make losses in trading, just make sure the losses are not too big.
That's the sentence. You don't really care about where the market is going, you are fine as long as you can handle your exits.
If you focus on 'when to enter' your system will be wrong most of the time, but if you focus on how to handle drawdowns you might get it right.
That's why TA books are only useful as door stoppers or monitor lifters.
- 1
-
22 hours ago, RedNoseSquirrel said:
hI jlz,
The content is not available now and when you search it says 403 forbidden. Is there any new search link for the EPICS
Thank you
It should work. Here is the definition of the service for more details.
https://labs.ig.com/rest-trading-api-reference/service-detail?id=613
-
-
17 hours ago, MichaelDE said:
Hi,
I placed a CFD Market-Order via https://demo-api.ig.com/gateway/deal/positions/otc (POST) as follows:
{"currencyCode": "EUR","dealReference": "TESTxy","direction": "BUY","epic": "IX.D.DAX.IFMM.IP","expiry": "-","forceOpen": "False","guaranteedStop": "False","orderType": "MARKET","size": 0.5}I obtained the deal confirmation via https://demo-api.ig.com/gateway/deal/confirms/TESTxy (GET) as follows:{"date": "2021-11-24T10:16:31.629","status": null,"reason": "MINIMUM_ORDER_SIZE_ERROR","dealStatus": "REJECTED","epic": "IX.D.DAX.IFMM.IP","expiry": null,"dealReference": "TESTxy","dealId": ...and so forth...My question is: What is the MINIMUM_ORDER_SIZE?Size 1.0 worked - is this the minimum?ThanksIn case that you want to automate the minimum size per market there is an endpoint for it.
https://labs.ig.com/rest-trading-api-reference/service-detail?id=594
The endpoint is /market/{epic}. It will give you the dealing rules for that market
- 1
-
They don't even allow you to post your email.
Ok let's try another route. I have edited the first pastebin we shared.
pass: DHAjBkgbjH
You can find my details there.
- 1
- 1
-
3 hours ago, Speedbird168l said:
Sorry @jlz, don't know what I'm missing but can't find said details on your profile.
There's a tab called 'About me' on every profile. If you are on mobile it is at the very bottom of the page aside from 'Activity'.
- 1
-
Hi, I have updated my profile with my GitHub account and email address.
- 1
- 1
-
I don't know . It doesn't show who they are so I can't get mad at anyone
- 1
- 1
-
I've got some followers on this forum that keep downvoting me everywhere
They are persistent.
- 1
- 1
-
Have they shut down your other post about the virus @Caseynotes?
You have been insulting people for months and now they act on it. Interesting. You have been way ruder before, you and your minion, the clown.
All the hard work that you have put into posting nonsense and memes from Twitter....They don't appreciate your purpose here.
Finally there is some moderation on this forum and you get what you deserve.
Frankieburgo is an unsung hero.
- 3
- 1
-
There are a lot of commented code that does not do anything. I removed anything that does not trigger any action, so it is easier to read.
I pasted the code here with some highlighting, https://pastebin.com/zkaJMCwa
The link is password protected. In order to see the file use the password: DHAjBkgbjHI can see in line 48 where the TradeInstrument function starts, and in line 243 where the position gets closed. But I can't see a "reopen" routine anywhere. In order to look for places where the position is being opened look for the word "createPosition". There is only one place in the code that opens a position. Bear in mind that lines that start with ' ' are meant to be comments and do not do anything.
I was expecting a call to create a new position after the stop is hit but I can't see it. Either you have some extra code that has not been posted or it is not implemented.
- 1
- 1
-
3 minutes ago, Speedbird168l said:
Wow. That's a generous and quick response. Thank you. I'm able to create a basket with a bulk of trades (initially inserting them manually) for pairing. They should auto re-open after closing when hitting the limit or loss. It's basically a trending tool which can invert the direction. It works sometimes and then it just hangs. I presume that might be because of the API call limit? I can mail you the sheet for your comments if you are willing to look at it?
I am not a Windows user, so I won't be able to open the Excel file. If you want to share anything send the VBA code in plain text. There are VBA developers in the forum , maybe they can help.
- 1
-
2 minutes ago, Speedbird168l said:
Thanks @jlz. I've had someone help me configure the excel VBA sample sheet to auto-reopen baskets of trades after closing them once a prescribed limit of loss has been reached. I am using the ig.com rest API endpoint in excel VBA with "/positions/otc" Post method (creating an OTC position). However, when using this API in loop, it creates trades a few positions and then just stops. The loop then is then stuck and excel hangs due to not responding. Happy to share the file with you if you wish?
Sure share the file, it will be easier to look at the code.
- 1
-
5 hours ago, Speedbird168l said:
Hello. I am trying to implement custom functionality into the excel VBA sample sheet where open trades close after reaching a limit or loss, and the auto-reopen (trade) again. I am using the ig.com rest API endpoint in excel VBA with "/positions/otc" Post method for trade (Creates an OTC position). When I am using this API in loop, it creates a few positions (trade) and stops giving the response. The loop then is stuck and excel hangs due to not responding.
Any suggestions? Is there any advanced version of "/positions/otc" POST API that creates positions in bulk which I can use in the loop that responds immediately?
You can't create positions in bulk, you are supposed to call the endpoint each time on every position.
A loop should be fine as long as you can handle all responses. Bear in mind that you are only allowed to call the endpoint a number of times per minute, if you pass that limit your positions will not be created. (the exact number was somewhere but I don't have it hand :D)
If you are able to create positions, your call to the endpoint is already working. In order to see where the problem is we would need to see the VBA code that you have written. I would bet on the way that code handles the response, bear in mind that the response is different when you have an error coming from the server.If you have a successful response where the position has been created you get a json like:
{
"dealReference": [positionReferenceId]
}
But if you have any error your response will be:
{
"errorCode": error code from the list [https://labs.ig.com/rest-trading-api-reference/service-detail?id=608]
}
If you are expecting the attribute dealReference and you get an error instead it will raise an exception and will hang Excel.
- 1
-
2 hours ago, Speedbird168l said:
Hello @jlz. You seem to be the go-to on API advice. Is it possible to have a chat?
No problem, what do you need?
- 1
- 1
-
Can you post the request headers?
This error is related to a wrong header value.
If you can't make the DELETE method to work use the POST method and set the _method header to DELETE.
- 2
-
12 hours ago, Augustin1978 said:
Looking at IG Labs and other pages, it is unclear if the (REST) APIs can be used to trade stocks / shares and ETF?
Thank you for any help and pointing to relevant links for this!
Happy trading! 🙂
No, check the account type in the glossary
- 1
-
On 16/10/2021 at 12:23, andysinclair said:
Hi,
Does anybody know if it is possible to plot my historical trades on a chart? I don't believe it is possible on the IG platform, however is there some other software that I could easily use to achieve this (linked to my IG account so the trades are plotted automatically).
I would like to do this so I can review my weeks trading, see where I made profit/loss and basically help me improve.
If nothing exists then as I am a software developer may look into building this for myself!
Thanks!
I use lightcharts from Trading View
If you need an example I put something together at:
https://github.com/AnAlgoTrader/AlgoReplay/tree/master/Monitor
The static.html file renders everything.
The realtime.html file renders candle by candle
- 3
Support for Share Dealing/ISA API access?
in IG Technical Support - Platform and App Help
Posted
The API is only available for Spreadbet and CFD accounts. That's why you get that error message.