Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

limit order to an indicator in strategy builder wont work

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

    limit order to an indicator in strategy builder wont work

    Hi,

    i want to make a strategy to work a limit order at an indicator value which will fill the moment the price trades that level. i cant figure our why when i backtest this strategy it wont work , no trades are taking place...

    Thanks,
    Tomer​Click image for larger version

Name:	צילום מסך 2023-08-05 233450.png
Views:	262
Size:	44.5 KB
ID:	1263240
    Attached Files

    #2
    Hello garmiza234,

    The code you have now would set the orders limit price to the indicator value and on each bar update the orders price. Are you certain that price is being met to fill the order?

    You may want to try enabling Trace Orders in the builders default properties screen and then open the NinjaScript output window to check if the order is being ignored or expired.

    Comment


      #3
      Hi Jesse,

      Thanks for the quick response.
      i managed to put one limit order on the first std band (as shown in the picture above), but i cant understand why it wont work when doing the same for 2 limit orders, i want to put one limit order at an std band and another order on a second std band above it, and set a profit on the first std, for some reason the second limit order wont be placed,
      logs- Strategy 'mulibands2code/-1': An order placed at '01/03/2023 01:04:00' has been ignored since the order was submitted before the strategy property BarsRequiredToTrade had been met.

      Comment


        #4
        Hello garmiza234,

        That message is just because your condition is always true, the orders start to be placed on the first historical bar which the platform blocks.

        To submit multiple orders you would have to change he EntriesPerDirection to 2 to allow the second order to be submitted in the same direction.

        Comment


          #5
          thanks it worked!

          but when i try to add the opposite orders (2 long limit orders) to the same strategy, things get random.
          any ideas?

          Comment


            #6
            Hello garmiza234,

            If you are adding the opposite without any conditions that would mean you are trying to submit both long and short trades at the same time. The strategy builder is meant to use conditions to differentiate long and short conditions. You add conditions in the top panel of the page that you had displayed.

            Comment


              #7
              thanks Jesse i will take that in mind.
              im trying to set a stop for the entire position, when i set a stop on the "stops and targets" section, as "stopp loss for the entire position" mode - currency i get the response - Stop/target handling set to 'By strategy position' since currency based stop order was placed.

              Comment


                #8
                Hello garmiza234,

                You would need to use a different calculation mode for the target, when you use Currency for the target the stop/target handling is set to by strategy position. You would need to use the other calculation modes that are available if you want to use that stop/target handling setting.

                Comment


                  #9
                  is there any other way of setting a stop market when my position gets to a certain drawdown? its very important for to be able to control the amount of the stop for backtesting and optimizing my strategy.
                  thanks!

                  Comment


                    #10
                    Hello garmiza234,

                    You can see the following examples of breakeven and trailing in the builder, that would be how to specify a custom price for a stop and modifying it later. You can access the positions unrealized pnl in the condition builder under the strategy folder. You could compare the pnl against a misc -> numeric value as a condition to change the stop price later.


                    Comment


                      #11
                      thank you for your patience Jesse!
                      ill check that out and let you know

                      Comment


                        #12
                        Hi,
                        I managed to set the conditions for the stop by currency, however it excecutes only on bar close so the stop price isnt accurate.
                        is it possible to be executed excactly on the stop price?

                        Comment


                          #13
                          Hello garmiza234,

                          In realtime you can use OnEachTick or OnPriceChange Calculate mode to allow the logic to be submitted intra bar. If you are backtesting that type of logic would be called OnBarClose.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by NullPointStrategies, Today, 05:17 AM
                          0 responses
                          44 views
                          0 likes
                          Last Post NullPointStrategies  
                          Started by argusthome, 03-08-2026, 10:06 AM
                          0 responses
                          124 views
                          0 likes
                          Last Post argusthome  
                          Started by NabilKhattabi, 03-06-2026, 11:18 AM
                          0 responses
                          65 views
                          0 likes
                          Last Post NabilKhattabi  
                          Started by Deep42, 03-06-2026, 12:28 AM
                          0 responses
                          42 views
                          0 likes
                          Last Post Deep42
                          by Deep42
                           
                          Started by TheRealMorford, 03-05-2026, 06:15 PM
                          0 responses
                          46 views
                          0 likes
                          Last Post TheRealMorford  
                          Working...
                          X