AndreyR wrote: ↑Tue Jan 12, 2021 9:44 amhi dmavro,
Do you need horizontal geometrical rays (lines that start and never end, hope I got you right)?
If yes, you can develop a module that will draw those for you. A good starting point is a Bookmap API Tutorial. What you need is everything from the start to (including) "Hello Bookmap addon in 2 minutes". You will learn how to start a project and to make a simple custom module.
Your task may be divided in two:
1) read a CSV file
You may use a library like OpenCSV. Here is a tutorial example. Note, there is a maven project used in the example and you will be using gradle project so your Set-Up will be looking differently (Google how to add a dependency to a gradle project).
So you'll need to read, store and transform the data to numerical values.
2) draw lines
To draw a ray all you need to register an indicator and to draw one point. Please take a look at LastTradeDemoNoHistory at simplified demo strategies.
Hello AndrejR,
Based on Bookmaps Demo class Layer1ApiMarkersDemo.java I adjusted the code a little so that it creates a CanvasIcon based on a csv input file. ( Essentially the CompositeVerticalCoordinate y2 variable value is populated from
the csv file. In that sense it's a static line attached to price level from csv file). That works well and Bookmap renders the object as expected (e.g level 16400 pips is converted into 4100 Points on ES Future)
However the code does this only for the first record in the csv file. After processing the first record it does not process more records aka iterating through the file.
I think this is because in line 250 when I return the lastPricePainter object the iteration stops completely.
However based on the CSV file I want to create more objects (each record of the csv should create a 'lastPricePainter' object)
I'm a real java beginner and I would be very greateful if you have an idea at hand on how to solve this problem. I attached the
code , screenshot and an example csv file with 2 records. Any input is much appreciated.
Thank you very much.
Daniel