[Build 136 Dev7] sqProject.getTaskByName sqProject.getTasks() does not work





In the example : https://strategyquant.com/doc/programming-for-sq/changing-task-config-programmatically/


the function sqProject.getTaskByName or sqProject.getTasks() does not work

1/      sqProject.getTaskByName won't find the task by name 

2/    sqProject.getTasks() will find only one task instead of 2 or more

I am getting an error , please see attached capture


We talk about it in our last coding session of 2022 11 09

Attachments
image-1.png
(112.96 KiB)
image-0.png
(109.70 KiB)
  • Votes +6
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

E
#1

Emmanuel

18.11.2022 12:41

Task created

E
#2

Emmanuel

18.11.2022 12:41
Voted for this task.
E
#3

Emmanuel

18.11.2022 12:46

Description changed:





In the example : https://strategyquant.com/doc/programming-for-sq/changing-task-config-programmatically/


the function sqProject.getTaskByName or sqProject.getTasks() does not work

1/      sqProject.getTaskByName won't find the task by name 

2/    sqProject.getTasks() will find only one task instead of 2 or more

I am getting an error , please see attached capture


We talk about it in our last coding session of 2022 11 09

Fs
#4

Fortunate

18.11.2022 18:30
Voted for this task.
TT
#5

Tamas

24.11.2022 10:53

Status changed from New to Waiting for information

Hello Emmanuel, 


the functions are working. We did not change the API of SQProject object


SQProject project = ProjectEngine.get(projectName);


ISQTask task = project.getTaskByName(taskName);

List<ISQTask> tasks = project.getTasks();


If you need help please attach the problematic snippet

E
#6

Emmanuel

24.11.2022 17:11
the function are running not correctly


We already discuss it in coding session with Mark


the example : 


https://strategyquant.com/doc/programming-for-sq/changing-task-config-programmatically/


does not work anymore


Please , test this example.


Both command run but read only one task


https://discord.com/channels/902103102289748038/1034809001248047134/1039897496735989822


we can not wait Build 137 to fix this



TT
#7

Tamas

24.11.2022 17:23
Ok, I understand. I will look at it tomorrow and let you know. Tamas
a
#8

astral

24.11.2022 17:23
Voted for this task.
E
#9

Emmanuel

24.11.2022 17:32
Thank you Tamas
b
#10

bentra

24.11.2022 20:31
Voted for this task.
b
#11

binhsir

25.11.2022 08:16
Voted for this task.
TT
#12

Tamas

25.11.2022 14:34

Attachment image-0.png added

image-0.png
(369.12 KiB)
Emmanuel I have tried it and it works fine for me.


Both of api calls are correct

ISQTask task = project.getTaskByName(taskName);

List<ISQTask> tasks = project.getTasks();


Here is a short code how to print list of task names....

ArrayList<ISQTask> tasks = sqProject.getTasks(); System.out.println("Tasks count " + tasks.size()); for(int i=0; i<tasks.size(); i++) { System.out.println("Task "+i+": " + tasks.get(i).getCustomName()); }


 ISQTask buildTask = sqProject.getTaskByName("Build strategies");


based on discord. getTaskByName() works with task name, not with title. Title is just for UI purpose.



E
#13

Emmanuel

25.11.2022 20:18

Attachment image-0.png added

Attachment Solution.mp4 added

image-0.png
(54.40 KiB)
Solution.mp4
(7.49 MiB)
Thank you so much Tamas for your help


Your testing , your code and your screen capture help me to understand.


The function did not work because I was using the mouse menu to start a single task (see attached capture)


it can not find the other task :


20:00:39.089 [Thread-75984] INFO  c.s.tradinglib.CustomAnalysisMethod - Tasks count : 1

20:00:39.090 [Thread-75984] INFO  c.s.tradinglib.CustomAnalysisMethod - Task 0: Custom analysis 2



But if I click on the green button to run the all project , the custom analysis is working :


20:01:03.979 [Thread-76688] INFO  c.s.tradinglib.CustomAnalysisMethod - Tasks count : 3

20:01:03.979 [Thread-76688] INFO  c.s.tradinglib.CustomAnalysisMethod - Task 0: Custom analysis 2

20:01:03.979 [Thread-76688] INFO  c.s.tradinglib.CustomAnalysisMethod - Task 1: Build strategies

20:01:03.979 [Thread-76688] INFO  c.s.tradinglib.CustomAnalysisMethod - Task 2: Build strategies 1



Thank you so much for your help and your work


Bt
#14

beetrader

28.11.2022 00:59
Voted for this task.
TT
#15

Tamas

06.12.2022 14:31

Status changed from Waiting for information to Fixed


Votes: +6

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please