Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Breakeven on strategy builder

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

    #46
    Originally posted by twomeangreens View Post

    Where in this strategy could I add a simple take profit condition?
    I attempted to add a hard take profit but that seems to cancel out the break even functionality.
    Hello twomeangreens,

    Thank you for your note.

    Since this strategy is using an ExitLongStopMarket() order for the stop loss, you will also need to use an exit order for the profit target. You could add a condition set that checks if the market position is long, then have the action set to ExitLongLimit at your desired profit target price for example. My colleague has created a strategy builder strategy that demonstrates how to use exit methods to have both a stop loss and a profit target. That example may be found here:


    Please let us know if we may be of further assistance.

    Comment


      #47
      Hi Team Ninja

      I am still trying to understand the "ram leaking" problem. When using the template you provided on page 1 "LongShortBreakEvenBuilderExample.zip (9.0 KB)" I experience this issue. 32Gb ram is built up in 4 Min during optimization. Then soon after that it freezes. Can you help me to understand why this happens?

      I am having another strategy built in Strategy Builder using only one BreakevenBool instead of INT to store prices and this strategy does NOT have the memory built up although it works the same. It clears memory during the process of optimizing and does not freeze/crash for hours. May the INT/Bool be the reason? Any advices on how to prevent this issue?​

      Comment


        #48
        Originally posted by Browniver View Post
        Hi Team Ninja

        I am still trying to understand the "ram leaking" problem. When using the template you provided on page 1 "LongShortBreakEvenBuilderExample.zip (9.0 KB)" I experience this issue. 32Gb ram is built up in 4 Min during optimization. Then soon after that it freezes. Can you help me to understand why this happens?

        I am having another strategy built in Strategy Builder using only one BreakevenBool instead of INT to store prices and this strategy does NOT have the memory built up although it works the same. It clears memory during the process of optimizing and does not freeze/crash for hours. May the INT/Bool be the reason? Any advices on how to prevent this issue?​
        Hello Browniver,

        Thank you for your note.

        What are the optimization settings you are using for the LongShortBreakEvenBuilderExample strategy? Please provide a screenshot of your optimization settings so I may test them on my end with this strategy as well.
        • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
        • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
        ​I look forward to your reply.

        Comment


          #49
          Hi Emily

          It does not matter what optimization settings I am using. Strategy "RamLeakageTest1" always leaks ram. It does not matter what settings I use.It is the strategy that is provided on page 1 of this thread. (LongShortBreakEvenBuilderExample.zip​). "RamLeakageTest3" does NOT leak Ram. It uses a bool for saving Breakevenprice no INT. Any ideas why this is?

          I use for both strategies a RSI as entry condition so its easy to compare.

          Attached Files

          Comment


            #50
            How can I upload the 2 cs files?
            "RamLeakageTest1" and "RamLeakageTest3"

            Comment


              #51
              Originally posted by Browniver View Post
              Hi Emily

              It does not matter what optimization settings I am using. Strategy "RamLeakageTest1" always leaks ram. It does not matter what settings I use.It is the strategy that is provided on page 1 of this thread. (LongShortBreakEvenBuilderExample.zip​). "RamLeakageTest3" does NOT leak Ram. It uses a bool for saving Breakevenprice no INT. Any ideas why this is?

              I use for both strategies a RSI as entry condition so its easy to compare.
              Hello Browniver,

              Thank you for your reply.

              Please check the Log tab of the Control Center after running each test. Do you see logged messages for the RamLeakageTest3 strategy? Even so, are there significantly fewer messages than with the RamLeakageTest1 strategy test? Each log entry takes memory to keep it loaded in the Log tab of the Control Center and I suspect that, due to the many iterations being run for the example settings you provided, multiplied by however many log messages are generated for each iteration (for example, I got many messages about orders being ignored due to BarsRequiredToTrade not being met), this would cause a large portion of memory to be allocated to logging these messages. Other items that can affect optimization performance are listed here:


              You may need to consider what messages are being logged and why, then you could modify the strategy or its settings in order to prevent those errors/logged messages from occurring (or at least reduce the number of messages to improve memory-related performance).

              Please let us know if we may be of further assistance.

              Comment


                #52
                No Emily. There are no messages in the Log for both strategies.

                Comment


                  #53
                  Originally posted by Browniver View Post
                  No Emily. There are no messages in the Log for both strategies.
                  I would like to review your diagnostic files along with both versions of the strategy you are testing. You can send these files by going to the Control Center-> Help-> Email Support. Ensuring 'Log and Trace Files' is checked will include the log and trace files. This is checked by default. Please also export your two strategies via the Control Center > Tools > Export > NinjaScript AddOn function. The .zip file that is generated may then be attached to your support email. Please include "ATTN Emily C" in the subject line as well as a link to this forum thread in the body of the email so the support request is routed appropriately.

                  I appreciate your patience and look forward to assisting you further.​

                  Comment


                    #54
                    Hello,
                    I have implemented the longshort breakeven example in the strategy I build. There is an issue with this: when an entry Stop order is cancelled (didn't reach the stop price) the TriggerState stays at 1 and the whole breakeven scheme does not work.
                    The only indication I see in the case of a cancelled order is in the Log. Is there a way to know if an order was cancelled so I can reset the TriggerState variable?
                    Thanks, Michael

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by NullPointStrategies, Yesterday, 05:17 AM
                    0 responses
                    65 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    139 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