Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need help in developing Fractal Strategy

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

    Need help in developing Fractal Strategy

    Hi All,

    Need help in developing this strategy



    You can download the custom indicator from the above thread.

    Regards
    Sujay

    #2
    Originally posted by ssijbabu View Post
    Hi All,

    Need help in developing this strategy



    You can download the custom indicator from the above thread.

    Regards
    Sujay
    Sounds like a straight out use for the Strategy Wizard. Open it up, and set the conditions. They both look like a simple price-cross over Plots.

    Comment


      #3
      Originally posted by koganam View Post
      Sounds like a straight out use for the Strategy Wizard. Open it up, and set the conditions. They both look like a simple price-cross over Plots.
      I developed a strategy for fixed stop loss and take profit (Strategy 2).

      But for the first strategy, i dont know how to create the exit condition.

      Please help me.

      Regards,
      Sujay

      Comment


        #4
        Originally posted by ssijbabu View Post
        I developed a strategy for fixed stop loss and take profit (Strategy 2).

        But for the first strategy, i dont know how to create the exit condition.

        Please help me.

        Regards,
        Sujay
        You said it yourself: you want to close at the end of the day. NT has a function called ExitOnClose. That seems to be what it means.

        Add the directives to your Initialize() function. Here is the shell:

        Code:
        protected override  void Initialize()
        {
            // Triggers the exit on close function 30 seconds  prior to session end
            ExitOnClose =  true;
            ExitOnCloseSeconds =  30;
        }
        I do not think that you can add those from the Wizard, so you are going to have to unlock the code.

        Comment


          #5
          Hi Sujay,
          The above will not be good for instruments that are open later than 4:15 PM. For example CL closes at 5:15 PM EST and TF closes at 6:00 PM EST and you want to get out before 4:15PM EST.

          You could also use the time function to close your position before a major financial news release by using ToTime function
          if (ToTime(Time[0]) >= 92000 || ToTime(Time[0]) <= 925000)
          {
          ExitLong(); //Managed Orders
          //ExitShort():
          return;
          }
          OR do not take a position until the news has released or Market has opened.

          if (ToTime(Time[0]) <= 93500)
          {
          return;
          }
          //if (ToTime(Time[0]) <= 120000 || ToTime(Time[0]) >= 161300)
          {
          ExitLong();
          return;
          }
          Put these before your code in OnBarUpdate()

          Comment


            #6
            Originally posted by mypkonline View Post
            Hi Sujay,
            The above will not be good for instruments that are open later than 4:15 PM. For example CL closes at 5:15 PM EST and TF closes at 6:00 PM EST and you want to get out before 4:15PM EST.
            ExitOnClose doesn't always exit @ 4:15 EST, it exits at the end time specified in the session template you're using.

            Comment


              #7
              Agreed!
              However, I use one strategy for 5 different instruments. It will not work for my if I want close all before 4:15PM EST.

              Comment


                #8
                Originally posted by mypkonline View Post
                Hi Sujay,
                The above will not be good for instruments that are open later than 4:15 PM. For example CL closes at 5:15 PM EST and TF closes at 6:00 PM EST and you want to get out before 4:15PM EST.

                You could also use the time function to close your position before a major financial news release by using ToTime function


                OR do not take a position until the news has released or Market has opened.





                Put these before your code in OnBarUpdate()
                The OP made a very specific request.

                Code:
                Strategy 1:
                
                Enter:
                Enter long when the price cross upper line or short when the price cross lower line.
                
                [COLOR=Red][B]Exit:[/B]
                At the [B]end of the day[/B] (close price of the day).[/COLOR]
                There is no mention of 4:15 PM EDT or any other time. I responded to the request made; not made assumptions as to what was wanted. "End of the day", is "end of the day", not 4:15 PM.

                When I ask a client for requirements, or even if I answer for free, I expect precision in specification. Indeed, if the scope of work said "end of the day" and I coded that, and the client came back to say what you just said about different instruments closing at different times, I expect that the client would know that, and if he wanted code to close at a specific time regardless of instrument, then that is what the scope-of-work should have said. I would consider it a change in the scope of work, and it would be billable.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                648 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                369 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                108 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                573 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                575 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X