Skip to content

How to set the position of TP/SL during initialization? #415

Description

@ujfjntevtee28230

According to the document convention, I implemented 'IBrokerWithoutRealtime' in the code. When initializing the position acquisition, I obtained the takeProfit/stopLoss fields, and their values ​​are inconsistent; but why is there only one line on the chart showing the draggable TP/SL button? I understand that the data and the chart are bound, but now it seems that this is not the case. If I want to immediately draw the takeProfit/stopLoss in the positions to the corresponding TP/SL line after obtaining them, what should I do?
Looking forward to your reply, thank you very much.

Version:charting_library V26.
Example:
export default class BrokerApi implements IBrokerWithoutRealtime {
...
async positions(): Promise<Position[]> {
const position = await Store.position.get();
return position || [];
}
...
}

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions