Main Content

Results for

Hi all,
I am wondering whats the total cost to use MATLAB for algo trading. The transparent part is of coz the price of matlab and the toolboxes. But I was shocked to find out the APIs to connect to Interactive Brokers are not free (costly in fact!). Is there free API to connect to IB? What other hidden costs are there? I saw the X Trader in the Automated Trading with MATLAB video. Is this XTrader software part of MATLAB toolbox? Do we need to pay additional to Trading Technologies (to use X_Trader). Also what data feed is the most cost effecient? Is there any additional hidden cost that I am not aware of?
Thanks!
Hi
I used to have the following daily max, min and mean code working. But, this week it seems to work for max and mins but not means. Any idea what's going on?
writeAPIKey = 'xxxxxx';
% Define date range of 1 day
end1 = datetime('now')
start=datetime('today')
% Read Weight data from Field1 for last 24 hrs
[Weight, time] = thingSpeakRead(xxxxxx,'DateRange', [start,end1], 'Fields', [1]);
Wtmax = max(Weight); % Get 24hr Max
Wtmin = min(Weight); % Get 24hr Min
Wtav = mean(Weight); % Get 24hr Av
% display results
display(Wtmax, 'Wt_max'), display(Wtmin, 'Wt_min'), display(Wtav, 'Wtav');
Output:
end1 =
datetime
30-Jan-2023 14:00:35
start =
datetime
30-Jan-2023
Wt_max =
-0.0685
Wt_min =
-0.5190
Wtav =
NaN
Good morning,
I am trying to receive a long number in thingspeak and convert it to a string. However, when I receive it, it converts it to a number using scientific notation. I have tried changing the format to long g and others and was able to get rid of the scientific notation part.
After doing so, I have used commands such as num2str, mat2str, and compose to represent the number as a string, but I keep getting results that are off. An example is a message i am sending as:
field1=100630000553400000000
using an MQTT desktop client. However, when I receive it and print the result, I get:
0100630000553399992320
The numbers are close but the right one. Is there something I am missing?
Thanks in advance!
Pedro Ch.
I want to import data from a .cvs with the requested format but constantly the same error comes out : "The uploaded file was not imported because it is missing timestamps."
My data is in this format:
created_at,field1,field2,field3
1600064881,50.818,0,0
Could someone help me fix it?
Thank you
I want to understand this from the scratch, i will appreciate help and guidance very much.
Pedro
Pedro
Last activity on 25 Jan 2023

Hi, what would be the best approach to use the gauge widget to display calculated data? I have a channel that displays a value that needs some math applied to it to give a correct value. I have a matlab visualization that converts this value into what I need and plots it. However, i believe a gauge is more appropriate than a plot and it seems the matlab "uigauge" object does not work for thingspeak.
Is there a way for the gauge widget to show my data coming out of the matlab script?
Thanks!
Louis
Louis
Last activity on 6 Jan 2023

Accidentally clicked on the "X" and field 1 chart disappeared. How do I recall the chart ?

Hi,
I'm trying to send data from a LoRa Node to the dragino Lg01-N gateway and then to the thinkspeak platform. Actually, the data arrives to the gateway and i get the following result read from the gateway
but the value does not reach the thingspeak platform.
on the other side i tried to send the data manually from the gateway using the following command
and the data is written successfully at the thingspeak. In this link we set the topic -t as channels/XXXXX/publish. but at the first figure the topic which is sent automatically from the gateway to the thingspeak is channels/XXXXX/publish/APIkey
i think the problem is here. i don't know how to change the form of the topic received by the gateway and sent to the thingspeak...is it possible to modify that? i tried to modify the mqtt_process.sh file, but all my changes do not make anny effect on the received packet from the lora node.
could you help me please to resolve this problem?
thank you in advance
Hello, I need help with a simple example. I am trying to do a simple bulk update using JSON in Javascript, using this parm, header and body:
$.post("https://api.thingspeak.com/channels/xxxxxxxxx/bulk_update.json" ,{
"Content-Type": "application/json",
"write_api_key" : "xxxxxxxxxxxxxxxx",
"updates": [
{
"created_at": "2022-12-30 10:26:2 -0800",
"field1": 100,
"field2": 100,
"field3": 200,
"field5": 600
},
{
"created_at": "2022-01-12 10:27:2 -0800",
"field2": 100,
"field3": 200,
"field5": 600
}],
function(data){
console.log(data) // log anything returned to the console
}
});
When I run the above (Mac OS, Chrome, Javascript) I receive this error message:
Access to XMLHttpRequest at 'https://api.thingspeak.com/channels/1283582/bulk_update.json' from origin 'https://backpaqlabs.com'
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
api.thingspeak.com/channels/1283582/bulk_update.json:1
Failed to load resource: net::ERR_FAILED
Is there something wrong with the syntax or JSON payload that can cause this CORS error? I have tried both local command line and from my hosted server. I am starting to see CORS errors with Javascript getJSON calls as well, so wondering if there is something going on at the endpoint. In this example, I have literally taken it from the example in the doc, so I assume it should comply with the API endpoint. Does seem to work OK with same code on Postman and CURL, so I believe syntax is correct. Ideas?
Any help appreciated!
Hi, having problems with this model. Tried changing all the capacitor values without any success. Any help/suggestions would be most welcome.
Hi there,
I am attempting to obtain a location history (thus the location of each of the previous messages recived) and the current location of my device on Thingspeak. I have not found any examples of how to do this on Thingspeak. Please may someone guide me or advise me on how to do this.
Thank you
When making a ThingHttp request via POST, the server response header does not include: "Content-Length:". Instead it is using "Transfer-Encoding: chunked". This makes it dificult to confirm that the entire response has been recieved. Any way to change this?
21:09:55.812 -> POST /apps/thinghttp/send_request HTTP/1.1
21:09:55.812 -> Host: api.thingspeak.com
21:09:55.812 -> Content-Type: application/x-www-form-urlencoded
21:09:55.812 -> Content-Length: 60
21:09:55.812 ->
21:09:55.812 -> headers=false&api_key=[removed]&message=Arduino Reset
21:09:55.906 ->
21:09:57.040 ->
21:09:57.040 ->
21:09:57.040 -> HTTP/1.1 200 OK
21:09:57.040 -> Date: Thu, 15 Dec 2022 02:09:57 GMT
21:09:57.040 -> Content-Type: text/html; charset=utf-8
21:09:57.040 -> Transfer-Encoding: chunked
21:09:57.040 -> Connection: keep-alive
21:09:57.040 -> Status: 200 OK
21:09:57.040 -> Cache-Control: max-age=0, private, must-revalidate
21:09:57.040 -> X-Request-Id: 798bbb62-da97-4ff8-a15b-c60b68fd60d3
21:09:57.040 -> ETag: W/"408e73c03e9c23fc2318c396c21c09e8"
21:09:57.040 ->
21:09:57.040 -> 2d
21:09:57.040 -> Congratulations! You've fired the alert event
21:09:57.040 -> 0
21:09:57.040 ->
I am trying to send data to a channel using thingspeak writefield and I keep getting an error no matching function... On reading the documents I am having a problem with "Write key". I can find no info on write key. what is it?
Hi there, I have been attempting to try and access the loaction of my device using the following code:
myChannel=*******;
ReadAPIKey='xxxxxxxxxxxx';
myData=thingSpeakRead(myChannel,'ReadKey', ReadAPIKey,'numpoints',100,'outputformat','timetable','location',1);
myVector=(myData.Latitude).^2+(myData.Longitude).^2+myData.Altitude.^2;
maxVector=max(myData.Latitude)^2+max(myData.Longitude)^2+max(myData.Altitude)^2;
myVector=myVector/maxVector;
myMap=geoscatter(myData.lat,myData.long,15,myVector,'filled');
geobasemap('satellite');
colormap jet;
I have about 100 entry points at this stage. However, i get the following error:
Error using .
Unrecognized table variable name 'lat'.
Error in Custom (no starter code) 2 (line 7)
myMap=geoscatter(myData.lat,myData.long,15,myVector,'filled');
I am attempting to access the location of a moving device. Meaning, the longitude and latitude values will be constantly changing, thus, I do not want to set my latitude or longitude value as a constant but i want it to keep on updating as my device moves around. How would I do this? How would I ammend this error without setting the "lat" or "long" as a consant before hand?
Further, my device should be constantly sending messages, this, the number of entries to which it will see the location of will be contantly changing. How can I thus not set the entry points as a specific value but rather have it update as my device sends messags?
Is there an easier or better way to do this?
Thanks
Hello, I have a some problem with my OneWire communication and ThingSpeak (ESP8266). Quiet often I have got -127 value, but everything with connections should be OK. I have a free license a TS and two channels in my account. I think that this piece of code may be problem:
void loop()
{
readKWHMeterPC();
readKWHMeterHeat();
read3WayValve();
digitalWrite(POWER_LED, LOW);
if ((millis() - lastTimeLoop) >= DELAY_TIME_LOOP){
readTemperatures();
calcenergyPC();
calcenergyHeat();
avgpowerPC(); // nie liczy w pierwszym przebiegu pracy dokładnie i w ostatnim, bo niekoniecznie jest załączenie/wył. równą minutę przed wysłaniem na TS -> w efekcie liczy moc z mniejszej ilości impulsów niż normalnie w ciągu minuty jest przy stałym obciążeniu
avgpowerHeat();
write2TSDataCH1( CH1channelID , CH1dataFieldOne , valveState , CH1dataFieldTwo , meterPulsesPC, CH1dataFieldThree, energyPC, CH1dataFieldFour, meterPulsesHeat , CH1dataFieldFive ,energyHeat, CH1dataFieldSix , powerPC, CH1dataFieldSeven, powerHeat );
write2TSDataCH2( CH2channelID , CH2dataFieldOne , tempC1 , CH2dataFieldTwo , tempC2, CH2dataFieldThree, tempC3 );
lastTimeLoop = millis();
}
Can I send data to TS to 2 channels in the same time or not?
There are two kinds of text data type (=string data type) in MATLAB:
Text1='aText'; % first one
Text2="aText"; % first one
The second one did not exist in "old" MATLAB versions but the first one only.
My questions are: 1) What was motivation of MathWorks programmers to introduce the Text Data Type of the second format?
Yes, I know the difference: length(Text1)=5 whilst length(Text2)=1; Text1(2)='T' but Text2(2) does not exist. The array Text3=['one' ; 'fifth'] does not exist too.
2) However, any explanations and recommendations how to apply the second sort in contrast to the first one?
3) Is there any way how to convert one sort to another one?
Thanks for explanation in advance!
Hi, I want to collect the simulation data by using NASA HL-20 model, then the data will transmit to ThingSpeak. However, I don't have the block for ThingSpeak Channel at the Simulink Library Browser. Is it because the block has its own version of simulink (meaning I have to update my version) or is there any else that I don't know? Besides, can you suggest which methods are suitable for me to successfully transfer the simulation data to ThingSpeak?
We have to create a few 10s of channels all with the same public view and settings. Is there any way of automating this ?
Doing it manually is time consuming and results in omissions and small mistakes.
Hi there, I am trying to reach out to anyone who has successfully completed the project of building a weather station using an Arduino MKRFOX1200 board, a dht11 sensor across the Sigfox and Thingspeak networks. I’ve been attempting to build the weather station over the SigFox and things.io network for over a year now but I was unsuccessful. I then found this tutorial on how to build this using Thingspeak: https://create.arduino.cc/projecthub/masteruan/arduino-mkr-fox-1200-sigfox-meteo-station-423609 . I have now been attempting to build it using this network but am still unsuccessful.
My SigFox and arduino is working. I made the arduino code convert temperature to Celsius (rather than Kelvin which is what the tutorial does). However, I am unable to access the location of the device on Thingspeak (my SigFox atlas is activated) and I am getting humidity values of approximately -30k. Please may someone assist me or give me a detailed approach on how to fix these issues. My goal is to have my thingspeak like this: https://thingspeak.com/channels/227248. I have followed the tutorial and projecthub but I cannot figure out why I am obtaining a confusing humidity reading. Please please may someone help.
Thank you so much for your time.
hello, how i can show module image in to public view.
in widget public dont show the option.
exist any code for MATLAB?