Gamestudio Links
Zorro Links
Newest Posts
How to: plot a frequency spectrum in bars?
by Sempervirens. 05/12/21 02:45
Backtest accuracy
by AndrewAMD. 05/12/21 00:26
Test one asset with more bar period in one run
by AndrewAMD. 05/12/21 00:22
System with more take profit
by AndrewAMD. 05/12/21 00:20
EXANTE broker
by madpower2000. 05/11/21 17:02
No Trades when Backtesting Period is longer
by TimmiHendrix. 05/11/21 15:47
Last Candle for Testing and Train?
by jcl. 05/11/21 12:14
DataSplit for Advise
by TimmiHendrix. 05/11/21 10:40
AUM Magazine
Latest Screens
Hecknex World
Scheherazade's Journey
Paradox Vector
The Space Between
Who's Online Now
3 registered members (AndrewAMD, Sempervirens, jyd), 470 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ShadowAx, TimmiHendrix, contactmmfx, msupl7, Robert_
18644 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Saving a string with more than 3 characters in a dataset #482911
04/16/21 09:31
04/16/21 09:31
Joined: Apr 2021
Posts: 6
V
VizTra Offline OP
Newbie
VizTra  Offline OP
Newbie
V

Joined: Apr 2021
Posts: 6
Hello,

I'd like to know, how to save a string in a dataset that is bigger than 3 characters.

What I've got so far:

Quote
dataNew(1, NumAssetsListed, 3);

string tickerString = dataStr(1, 0, 1);
strcpy(tickerString, "AAPL");

dataSet(1, 0, 2, 0.05);
dataSaveCSV(1, "f0,sss,f2,f3", "AppleMomentum.csv");


What I know so far is, that when importing a .csv you can select the format and in that case you can import the csv with a format contain "sss" to import strings bigger than 3 chars. But what about creating completeley new datasets within Zorro?
I create a dataset with dataNew() and then take the pointer to the string field via dataStr(), without being able to somewhere make sure the string can be bigger than 3 characters.

I'm probably missing something.

Kind regards,

Re: Saving a string with more than 3 characters in a dataset [Re: VizTra] #482920
04/16/21 14:51
04/16/21 14:51
Joined: Jul 2000
Posts: 27,493
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,493
Frankfurt
You can store a string as long as you want, but you need to reserve one more field for any 4 more characters. Those fields then hold a part of the string and cannot contain numbers.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1