Skip to content

Access the first candle of the session. next() always give the 2nd element #1179

Closed as not planned
@Shishir-Bondre

Description

@Shishir-Bondre

Expected Behavior

  • How can I access the first candle of the session ? I want to test the strategy which takes the trade on first candle.

Actual Behavior

           class Scalping(Strategy):
                     def init(self):
                           pass

                     def next(self):
                           if len(self.data) == 1:
                                self..buy()

Steps to Reproduce

  1. Currently I cannot access the 1st price points
           class Scalping(Strategy):
                     def init(self):
                           pass

                     def next(self):
                           if len(self.data) == 1:
                                self..buy()
                                # not executed currently

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis is not a (valid) bug report

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions