Hi, Could anybody tell me please what's the script to get the Open Interest data in Pinescript? - performance

I'm learning pinescript and i would like to know if there is a way to get the open interest of any ticker using pinescript.
Thanks in advance.
I'm trying
//#version=5
indicator("Open Interest")
oio = request.security("AAPL",timeframe.period,open)
oih = request.security("AAPL",timeframe.period,high)
oil = request.security("AAPL",timeframe.period,low)
oic = request.security("AAPL",timeframe.period,close)
But i'm not sure...

Related

Why can't I make a table using gtsummary?

I'm quite new to R, just been using it for the past month or so for my master's thesis. I finally (hopefully) have figured out my model and now i'm trying to present it in a table. After some research, everyone seems to really love the gtsummary package and I really want to learn to use it. But for some reason, the most basic function is not working for me.
Here's my lmer model:
res1 <- lmer(pH ~ Species * SedLayer + (+1|Site), data = data
summary(res1)
Anores1 <- Anova(res1)
Anores1
Which gives me quite a lot of output, output data frame. And here's the basic code i'm trying to use:
lmer(pH ~ SedLayer * Species + (+1|Site), data = dat)
#> Error in lmer(pH ~ SedLayer * Species + (+1 | Site), data = dat): could not find function "lmer"
Created on 2021-05-16 by the reprex package (v2.0.0)
And I keep getting the following error message:
Error in match.call() : ... used in a situation where it does not exist
I've got all the following packages installed and loaded:
library(stats)
library(rstatix)
library(car)
library(lme4)
library(lmerTest)
library("gtsummary")
library("gt")
library("broom.mixed")
library(tidyverse)
I'm sure I must be making a very silly mistake, but I cannot figure it out! Is my model somehow too weird to put in a table? Is there an additional package I should load? Or am I just writing it wrong?
Thanks for any help you can give me!

Trying to use the GET API to retrieve single term with elasticsearch and the JAVA API

I am new to elasticsearch but I am very close to getting the term, but I'm missing some small detail and I can't figure out what it is.
GetRequest getRequest = new GetRequest("registered", "users", id);
client.get(getRequest);
getRequest.storedFields("age");
GetResponse getResponse = client.get(getRequest);
String pw = getResponse.getField("age").getValue();
writer.println(getRequest);
When I try to run the above code I get a "nullPointerException". I have looked over the doc for the GET API https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-document-get.html but am getting nowhere. Any help someone could provide would be greatly appreciated.
what is the purpose of these two lines in the code ?
client.get(getRequest);
getRequest.storedFields("age");
I think this might be causing issues

Get info from API

I got a really tricky API where I'm getting some books info from. I would need to get the cover image when available though but I can't get it.
This is how my API looks like:
And this is my code to get till 'cover'. I can't select though the large cover.
#infos = HTTParty.get("http://openlibrary.org/api/books?bibkeys=ISBN:#{params[:isbn]}&jscmd=data&format=json")
#data = #infos["ISBN:#{params[:isbn]}"]
#cover = #data['cover]
As you can see I'm using Ruby. Any help guys?
try this
#infos = HTTParty.get("https://openlibrary.org/api/books?bibkeys=ISBN:#{params[:isbn]}&jscmd=data&format=json")
#data = #infos["ISBN:#{params[:isbn]}"]
#cover = #data['cover']["large"]
I'm a bit familiar with APIs.
Though I can't tell you EXACTLY what to do in terms of code, I can tell you that what you need to do is download Postman from the Google Chrome store and ctrl c ctrl v your link. This will then parse whatever code on that site into JSON format. You should then be able to see where your photo is located and then access it from there.

Reminder being executed only when adding new reminder

i am trying to use the reminder api but with no luck. The code that i use to create the reminder is located below. The thing that happens is that the reminder is not triggered until i add another reminder, att this point the old reminder goes of immediately. I guess this code does not say much as it is almost copy pasted from Microsoft's tutorial on reminders. however i do not know where the problem could be otherwise (i will post other code snippets if you have suggestions where the problem may lie)
Reminder notification = new Reminder(""+uniqueId);
notification.Title = "Title";
notification.Content = "Content";
notification.BeginTime = DateTime.Now.AddSeconds(10);
notification.RecurrenceType = RecurrenceInterval.None;
notification.NavigationUri = new Uri("/MyPage.xaml?id=" + uniqueId, UriKind.Relative);
// Register the reminder with the system.
ScheduledActionService.Add(notification);
Ok there was nothing wrong with the code. The emulators system time was set to automatic but was somehow going 20 min wrong which led to strange behaviour. After setting time manually it works as expected.

Correct initializion with arguments

Apologies for the dumb question, but I’m a beginner to Ruby.
I’m trying figure out how to pass arguments correctly to this gem from the constructor: https://github.com/miketierney/artii/blob/master/lib/artii/base.rb
I’m initializing an instance with artii = Artii::Base.new([]) but I’d like to pass a different font name as an argument.
I’ve tried artii = Artii::Base.new([:font_name => ’slant']) , as well as setting artii.font_name after initializing, but this doesn’t seem to work.
Can anyone tell me what I’m doing wrong?
Many thanks,
Stephan
Have you tried
artii = Artii::Base.new({:font_name => ’slant'})

Resources