Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Set conditions about number of trade per days and number of entries

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

    Set conditions about number of trade per days and number of entries

    Hello,

    Noob here with Strategy Builder. I am reading and studying tutorials and guide but i don't understand which conditions i need to use in order to:

    1)Set a maximum of 2 trades / day
    2)Allow or do not allow multiples entries.
    3)Allow an averaging up (or down) an existing position (via multiple entries)

    For the second point and third one, i tried to set Position.MarketPosition=MarketPosition.flat but seems to not working.
    I even set "Entries per direction = 1" and Entry Handilng = 1 in Default properties menu. It Seems to now working as well.

    Please help

    #2
    Hello marketplayer,

    Thank you for the post.

    1). Setting two maximum trades per day would be a little difficult in the builder as you would likely need to use two separate conditions for that case. The builder is unable to increment numbers so using a variable to count the entries would not work. You could use two variables to control logic or mark how many orders have been placed. If they were in the same direction you could use the Position quantity to control further entries as well.

    2). Do you mean at one time or for all time? Controlling multiple entries per direction is possible or controlling stopping entries after a criteria is also possible.

    3). I am not clear on your follow up statement. Are you saying that you are still having trouble here or that you see it now working well? Entries Per Direction simply controls the amount of entries you can place in a single direction at once. For example placing two long entries one after another, only 1 of those entries is permitted.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello marketplayer,

      Thank you for the post.

      1). Setting two maximum trades per day would be a little difficult in the builder as you would likely need to use two separate conditions for that case. The builder is unable to increment numbers so using a variable to count the entries would not work. You could use two variables to control logic or mark how many orders have been placed. If they were in the same direction you could use the Position quantity to control further entries as well.

      2). Do you mean at one time or for all time? Controlling multiple entries per direction is possible or controlling stopping entries after a criteria is also possible.

      3). I am not clear on your follow up statement. Are you saying that you are still having trouble here or that you see it now working well? Entries Per Direction simply controls the amount of entries you can place in a single direction at once. For example placing two long entries one after another, only 1 of those entries is permitted.


      I look forward to being of further assistance.
      3)So, if i set "Entries per direction = 1" allow me to take just 1 position and force the strategy to wait for close (tp or sl) in order to open a new one in the same direction. Is it correct?

      2)Basically is the same of 3) point. I want to know how to force the strategy to manage 1 position per time. In other words, even if conditions are met but there is an existing floating trade, strategy must ignoring the matching and don't take the (new) trade.

      Comment


        #4
        Hello,

        3)So, if i set "Entries per direction = 1" allow me to take just 1 position and force the strategy to wait for close (tp or sl) in order to open a new one in the same direction. Is it correct?
        Correct, the definition of this property is: Determines the maximum number of entries allowed per direction while a position is active.

        What specifically are you seeing that is not working in contrast to EntriesPerDirection? You noted you tried checking for flat and also modifying the entries per direction, what is the reason you are trying to modify these settings or what outcome are you observing?

        Have you also turned on TraceOrders to see if EntriesPerDirection is ignoring orders? https://ninjatrader.com/support/help...ub=traceorders
        If an order is ignored, you will see output for that if you have traceorders on.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello,



          Correct, the definition of this property is: Determines the maximum number of entries allowed per direction while a position is active.

          What specifically are you seeing that is not working in contrast to EntriesPerDirection? You noted you tried checking for flat and also modifying the entries per direction, what is the reason you are trying to modify these settings or what outcome are you observing?

          Have you also turned on TraceOrders to see if EntriesPerDirection is ignoring orders? https://ninjatrader.com/support/help...ub=traceorders
          If an order is ignored, you will see output for that if you have traceorders on.

          I look forward to being of further assistance.
          Ok please help me to understand how fix this situation. Backtest result attached. I am experimenting a stop loss fixed at 100 ticks (instrument: dax, 1 tick = 25 usd so MaxDD expected is 2500 usd)

          How is it possible that strategy get larger losses?

          I have EXIT on CLOSE Session enabled. I pasted the whole wizard strategy here: https://pastebin.com/vJw4suR3

          Attached Files

          Comment


            #6
            Hi marketplayer,
            What is the time frame of your primary data series?
            Are you sure, you have exit on session close enabled? 20: IsExitOnSessionCloseStrategy = false;
            Please check, if the unexpected high losses are due to overnight trades (only).
            If Yes, which trading hour template are you using? You allow new trades up until 17.30 ...
            What is the latest time trades were closed in your backtesting DURING the day at which the trade was opened?
            NT-Roland

            Comment


              #7
              Hello marketplayer,

              I am not certain I understand what you are asking here. The view you are showing is reported for a period of time which may equate to a total loss more than just 100 ticks worth of profit/loss. Are you expecting this view to show single trades or what is the general expectation for the values here? The other relevant information such as the data series being used is not provided here for me to know what the specific expectation may be however the view you have shown seems to be daily increments so if you placed more than one trade in that period it would be the net profit value for that period.



              I look forward to being of further assistance.


              JesseNinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Jesse View Post
                Hello marketplayer,

                I am not certain I understand what you are asking here. The view you are showing is reported for a period of time which may equate to a total loss more than just 100 ticks worth of profit/loss. Are you expecting this view to show single trades or what is the general expectation for the values here? The other relevant information such as the data series being used is not provided here for me to know what the specific expectation may be however the view you have shown seems to be daily increments so if you placed more than one trade in that period it would be the net profit value for that period.



                I look forward to being of further assistance.

                I expect that the larger losses for bad trades wouldn't be over 100 ticks, as i set into Order Management. The picture is coming from the Backtest analysis, which show profit/loss for singles trades in a sort of histogram plot.

                Comment


                  #9
                  Hello maketplayer,
                  Please look at individual trades in the Strategy Analyzer. Click on column Profit and sort them from worst to best. What is the biggest loss on a SINGLE trade? Close to 100 ticks or completely off?
                  NT-Roland

                  Comment


                    #10
                    Originally posted by NT-Roland View Post
                    Hello maketplayer,
                    Please look at individual trades in the Strategy Analyzer. Click on column Profit and sort them from worst to best. What is the biggest loss on a SINGLE trade? Close to 100 ticks or completely off?
                    NT-Roland
                    Completely off. This is my concern. I have losses of over 200 ticks shown in the analyzer

                    Comment


                      #11
                      Originally posted by marketplayer View Post

                      Completely off. This is my concern. I have losses of over 200 ticks shown in the analyzer
                      Does the Exit happen on the same day or do you have (unintentional) overnight trades closed on the next day?

                      Comment


                        #12
                        Originally posted by NT-Roland View Post

                        Does the Exit happen on the same day or do you have (unintentional) overnight trades closed on the next day?
                        I have "exit on close session" enabled. The chart is on the extended session (DAX). But i also set up a fixed stoploss of 100 ticks intraday. So i guess the strategy shoudl close if Price touch my SL, otherwise it close at the end of session

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Tim-c, Today, 03:54 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post Tim-c
                        by Tim-c
                         
                        Started by FrancisMorro, Today, 03:24 AM
                        0 responses
                        2 views
                        0 likes
                        Last Post FrancisMorro  
                        Started by Segwin, 05-07-2018, 02:15 PM
                        10 responses
                        1,772 views
                        0 likes
                        Last Post Leafcutter  
                        Started by Rapine Heihei, 04-23-2024, 07:51 PM
                        2 responses
                        31 views
                        0 likes
                        Last Post Max238
                        by Max238
                         
                        Started by Shansen, 08-30-2019, 10:18 PM
                        24 responses
                        945 views
                        0 likes
                        Last Post spwizard  
                        Working...
                        X