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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    61 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X