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
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
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);
List<ISQTask> tasks = project.getTasks();
If you need help please attach the problematic snippet
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
Attachment image-0.png added
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.
Attachment image-0.png added
Attachment Solution.mp4 added
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