For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

Indicator for multiple data feeds

  • I have read documentation and went over the issues that people had regarding this but still can't find an answer to my question so I am hoping someone can help me out here.
    Basically I have strategy that uses multiple data feeds (each feed is for specific equity) and I am creating own indicator.
    My understanding is, the output lines of the indicator will be array of lines (Line for each feed or equity). Is my understanding correct?
    If so, how do I define lines array inside the indicator? all I am seeing is
    lines = ('metric1','metric'2)
    If I have multiple feeds then I should have an array of metric1 and metric 2 for each feed, correct?
    Size of the array will be the number of the equities I am feeding to my strategy. That number will be known in my strategy and should be passed to indicator at instantiation. ?
    Can you somebody help?

  • administrators

    Sorry, but I cannot understand your message.

  • Let me guess. You have several feeds, and want to create an indicator which will be applied for each feed. If this assumption is correct, then you write your indicator and then apply it in the strategy __init()__ to each feed using for loop and dictionary to store indicator results.

    Check out this link, The Strategy section: Docs - Momentum Strategy.

Log in to reply