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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    32 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    195 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    356 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    277 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X