get parenrs and childs based on id
You can use a recursive CTE similar to the following to get the whole ancestor list (parents and children) for a given TradeID:
WITH RecursiveCTE_Children AS
(
    SELECT GeneratedFrom, TradeID
    FROM MyData

    UNION ALL

    SELECT RC.TradeID AS GeneratedFrom, MD.TradeID
    FROM RecursiveCTE_Children AS RC 
    INNER JOIN MyData AS MD
        ON RC.TradeID = MD.GeneratedFrom
),
RecursiveCTE_Ancestors AS
(
    SELECT GeneratedFrom, TradeID
    FROM MyData

    UNION ALL

    SELECT MD.GeneratedFrom, RC.GeneratedFrom AS TradeID
    FROM RecursiveCTE_Ancestors AS RC 
    INNER JOIN MyData AS MD
        ON RC.GeneratedFrom = MD.TradeID
)

SELECT TradeID
FROM RecursiveCTE_Children
WHERE GeneratedFrom = 32845

UNION

SELECT GeneratedFrom
FROM RecursiveCTE_Ancestors
WHERE TradeId = 32845