Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Builder Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Strategy Builder Question

    I have generated this
    1. Can you please tell me what does this line does - CrossoverDetected = false;
    2. Is (Position.MarketPosition == MarketPosition.Flat)) better to be part of entry logic? I have several strategies inside one strategy. I keep (Position.MarketPosition == MarketPosition.Flat)) as part of time filter. Is it better to keep it inside entry or it can be declared once inside time filter. Whats general rule? Thank you


    if ((CrossoverDetected == true)
    && ((CrossoverBar[5] - (CurrentBars[0])) == -5)
    // barspresent
    && ((BarsSinceExitExecution(0, "", 0) > 2)
    || (BarsSinceExitExecution(0, "", 0) == -1))
    && (Position.MarketPosition == MarketPosition.Flat))
    {
    EnterLong(Convert.ToInt32(DefaultQuantity), "");
    CrossoverDetected = false;
    }​

    #2
    Hi Boris, I moved your question into a new topic. The CrossoverDetected look like its a variable that you created in the builder, and by the looks of how it is being used, you are using this to prevent this cross condition from occurring more than once per bar. Checking the market position has nothing to do with a time filter, so it can be used outside of a time filter condition. It is used to check if the strategy position is flat.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    90 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    120 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X