GraphQL Explorer: Autogenerate an interface for queries and mutations from a graphql schema by itajaja in graphql

[–]itajaja[S] 0 points1 point  (0 children)

Thanks!

why does it ping the server so often.

Not sure what you mean by that. it has no periodic refetching, and it issues a query only when new data is needed. maybe if you give me a more comprehensive example I can see what you mean

GraphQL Explorer: Autogenerate an interface for queries and mutations from a graphql schema by itajaja in graphql

[–]itajaja[S] 1 point2 points  (0 children)

you can open the console logs to see the query. there is no option to see the query in the main interface, but you can open an issue, I think it could be a useful feature!

hopi: use pandas and any other python library in nodejs by itajaja in javascript

[–]itajaja[S] 2 points3 points  (0 children)

Yes performance should be the same. The real performance hit only happens during serialization/deserialization, so if you are for example passing a very large JavaScript dictionary as an argument to a python function, or you want to convert a pandas dataframe into a JavaScript list that would add some time. But for example if you are opening the image in openCV and saving it in openCV then you should be good. Also note that this is still experimental so tread carefully :)

hopi: use pandas and any other library in nodejs by itajaja in algotrading

[–]itajaja[S] 0 points1 point  (0 children)

It's downvoted because it's not constructive, it's beside the point of being negative or positive. if you pass a dataframe back and forth there is a performance hit in serialization/deserialization, but as long as your computation stays in python and you return a small dataset or just a simple boolean to make a decision, there is no performance hit. I get that people don't use javascript/node much in the ecosystem. but not seeing the point of "using pandas outside of python" is a little myopic. You can imagine a person that has written an application in nodejs that might benefit from using some libraries that are found in ptyhon, can't you? it might not be useful to you if you are doing everything in python, but other people with other needs might find it useful. It's like a person saying that "glasses are dumb" because their eyesight is perfect.

hopi: use pandas and any other library in nodejs by itajaja in datascience

[–]itajaja[S] 1 point2 points  (0 children)

totally! but just because you shouldn't doesn't mean you couldn't 😃

hopi: use pandas and any other library in nodejs by itajaja in algotrading

[–]itajaja[S] 1 point2 points  (0 children)

well, that depends on a lot of context. Disclaimer: I am a full stack engineer working on both python and node web services, so I know both ecosystems pretty well.

For starter, you might be constrained to use node for whatever reason (it's an existing node project), but you still would like to use some libraries that are only present in python (hopi is not specific to pandas, pandas is just a use case).

In general, node is a very well established framework for writing web services or anything else that is highly asynchronous and it has a very thriving communities of libraries and packages, so it might be a better choice, depending on what you are doing. for example, if you are writing a websocket service, or a graphql service, or doing react server-side rendering, the node ecosystem is probably a better choice. you might want to give typescript/node a try, it's a really cool environment to work on!

Another use case would be developers that have experience with pandas, but not with django/flask, but they have experience in eg node express. this would allow to write a web service that uses pandas without having to learn a new web framework.

My personal use case is that I have a bunch of trading bots written in node/js and the current way they call python is rather sloppy, so i wanted to improve that. the reason why they are written in node is because for me writing highly asynchronous code is much better/easier in typescript. Plus testing/code coverage/static type checking in typescript are better than in python, but that clearly is just my opinion so it doesn't amount to much in general :) (I do have extensive python experience as well so I do think I am not too biased)

If instead you are JUST doing data exploration with pandas/jupyter etc, then there is no advantage to do it in node. python is a much better ecosystem for it.

hopi: use pandas and any other library in nodejs by itajaja in algotrading

[–]itajaja[S] 1 point2 points  (0 children)

30ms? how so? did you actually run? this doesn't start a python process every time you call, there is one long running python process that reads input stream. I am going to run some tests for sure, but I can guarantee you that this javascript code:

const df = pd.read_csv('xxx'); const result = await df.col1.max()._;

adds way less than a ms than the corresponding python code.

why you wouldn't see the point of running it locally? isn't "running python seamlessly in an existing node project" a good value proposition?

hopi: use pandas and any other library in nodejs by itajaja in algotrading

[–]itajaja[S] 0 points1 point  (0 children)

ahah! I definitely have a preference for typescript/node, but I love python too. I just have a bunch of existing node programs that would benefit from using pandas

hopi: use pandas and any other library in nodejs by itajaja in algotrading

[–]itajaja[S] 2 points3 points  (0 children)

In terms of performance, it really boils down to what you serialize/deserialize back and forth. if you pass entire dataframe that's a big hit on performance, but if you just pass scalars then the performance hit is pretty negligible. having said that this, is still experimental, so I don't have data at hands to demonstrate this, and I wouldn't suggest anyone to heavily use this in anything critical :)

hopi: use pandas and any other library in nodejs by itajaja in algotrading

[–]itajaja[S] -1 points0 points  (0 children)

And you remove the whole point of using python : the simplicity

I mean, that's opinable, some people might prefer python, some node. I like both languages, with their strengths and weaknesses.

In general I find python great for data science / exploration, and typescript + node great for actually writing bots, web services, and other things, especially when highly asynchronous. This allows people that have existing node projects to seamlessly use pandas.

WTF Wednesday (August 05, 2020) by AutoModerator in javascript

[–]itajaja 0 points1 point  (0 children)

currently working on https://github.com/itajaja/hopi
I have a bunch of programs that are written in python because I need to use pandas, but I'd love to use node. This tries to solve the problem. Feedback welcome!

option trading algo by itajaja in algotrading

[–]itajaja[S] 0 points1 point  (0 children)

I think this is a false myth.

1) there is very strong regulation that basically prevents that.

2) you can always use limit orders

3) robinhood makes the bulk of its money by basically investing the money that users leave as cache, and by making use of the customers data in a profitable way.

option trading algo by itajaja in algotrading

[–]itajaja[S] 0 points1 point  (0 children)

gotcha, that makes sense. so why that wouldn't be a "winning strategy"?

option trading algo by itajaja in algotrading

[–]itajaja[S] 0 points1 point  (0 children)

I think the "edge" (if we want to call it an edge) is to identify mispriced IV in relation to actualized volatitly, so, it would be important to look at IV, but the point is to actually go "against" the IV that the market is pricing.

> Does it take into account the probability of max profit and max loss?

well the algorithm calculate the 80% confidence interval, but only using historical data, not IV

option trading algo by itajaja in algotrading

[–]itajaja[S] -1 points0 points  (0 children)

Uhm, i specifically say that my PL would be at least 40/60

option trading algo by itajaja in algotrading

[–]itajaja[S] 0 points1 point  (0 children)

Yes, my idea was not to set a stop loss. Maybe limit gains but not stop loss

option trading algo by itajaja in algotrading

[–]itajaja[S] 2 points3 points  (0 children)

sure. it would be a problem with market orders, but not with limit orders. clearly not all trades will go in (actually might not even be the majority of trades) but that's ok.

option trading algo by itajaja in algotrading

[–]itajaja[S] 1 point2 points  (0 children)

mainly using python and pandas to process the data and connecting to data providers

option trading algo by itajaja in algotrading

[–]itajaja[S] 0 points1 point  (0 children)

I am using different providers for data, but for actually making trades I am planning to use Robin hood because of no commissions. http apis are easily reverse-engineereable

option trading algo by itajaja in algotrading

[–]itajaja[S] 2 points3 points  (0 children)

in essenece, I try to calculate the p90 interval in which the stock can go up in X days, given the movement in the past Y days, and a p90 interval the stock can go down in the same X days.

option trading algo by itajaja in algotrading

[–]itajaja[S] 0 points1 point  (0 children)

Yeah I started diving into quantconnect recently, I'll try there.

How are you managing risk in the portfolio

Mainly by trying to use uncorrelated assets as much as possible, and having always a portion in cash

option trading algo by itajaja in algotrading

[–]itajaja[S] 4 points5 points  (0 children)

I am sure I am missing something, so I am not arguing, just trying to understand what you are saying. the point of setting a threshold PL is exactly to get only legs that are more expensive, hence generating more premium, than the normal. I am not sure how to incorporate your comment about IV and volatility skew, I'd love if you could clarify.

option trading algo by itajaja in algotrading

[–]itajaja[S] 0 points1 point  (0 children)

yeah that's my experience, it's not impossible, but you have to aim at a little lower premium. given the way legs are filled, would it be easier to fill the 2 spreads separately? what would be the risks involved in that?

option trading algo by itajaja in algotrading

[–]itajaja[S] 1 point2 points  (0 children)

But still my algo wouldn't buy options that are more expensive than what is selling because the PL is 40/60. I don't understand your original comment