Forum Discussion
Order Log / Chart improved visualization
- 7 months ago
Hi jonasdedual23 ,
This is a great visualization challenge. Your data model is already perfectly set up for this (Star Schema with a shared Timestamp dimension), which makes the solution straightforward.
To achieve that "Green/Red Cross" effect overlaying your price line, you need to create two specific measures that return a value only when an order occurs and return BLANK() everywhere else. By adding these to your line chart and formatting them as markers (without lines), you will get the exact result you sketched.
Here is the step-by-step implementation:
1. Create the Marker Measures
Since your Order_Log table likely doesn't have the exact "execution price" (or even if it does, you want the dot to sit perfectly on your price line), we will fetch the price from your candle_1m table whenever an order is detected.
Measure 1: Open Position Marker (Adjust the "open" text to match exactly what is in your Order_Log[action] column)
Trade Open Marker = VAR IsOpen = CALCULATE( COUNTROWS('Order_Log'), 'Order_Log'[action] = "open" -- Update "open" to match your data text ) > 0 RETURN IF( IsOpen, MAX('candle_1m'[close]), -- Plots the dot at the closing price of that candle BLANK() )Measure 2: Close Position Marker
Trade Close Marker = VAR IsClose = CALCULATE( COUNTROWS('Order_Log'), 'Order_Log'[action] = "close" ) > 0 RETURN IF( IsClose, MAX('candle_1m'[close]), BLANK() )2. Configure the Chart
Select your Line Chart.
Drag both [Trade Open Marker] and [Trade Close Marker] into the Y-axis (alongside your existing High/Low/MA lines).
Go to the Format Pane (paintbrush icon).
3. The "Invisible Line" Trick
Now you need to hide the lines for these new measures and only show the markers.
Go to Lines:
Select Apply Settings to: Trade Open Marker.
Set Stroke Width to 0 px.
Repeat for Trade Close Marker.
Go to Markers:
Toggle Shape to On.
Select Apply Settings to: Trade Open Marker.
Shape: Select + (Cross) or Circle.
Size: Increase it (e.g., 7 or 10) to make it stand out.
Color: Set to Green.
Repeat for Trade Close Marker (Select shape x or Square, Color Red).
4. Result
Your chart will now show a continuous line for the price, but whenever a timestamp has a matching row in Order_Log, a distinct Green or Red marker will appear exactly at that price point, matching your desired sketch.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
This response was assisted by AI for translation and formatting purposes.
Thank you for your response.
I' have added the measures. however, i am not able to see anything in the linechart when puting them on the y Chart.
What I have also noticed ist that the timestamp in candle_1m is rounded to minutes but the order_log has timestamps for every second. Therefore I have created this column:
timestamp_rounded =
DATE(
YEAR('Order_Log'[timestamp]),
MONTH('Order_Log'[timestamp]),
DAY('Order_Log'[timestamp])
) +
TIME(
HOUR('Order_Log'[timestamp]),
MINUTE('Order_Log'[timestamp]),
0
)I have then connected dim_timestamp to order_log with the new rounded calculated column:
However, the measure you have provided still doesn't show any data.
- AshokKunwar7 months agoContinued Contributor
I'm so glad it helped! Please mark this as an Accepted Solution so it stays at the top of the forum for others facing these performance issues."