Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry by an indicator signal

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

    Entry by an indicator signal

    Hello everyone. I wanna know how I can do an entry when an indicator signal appears. I did it using a loop, but the problem is that I can't filter when a signal appears. So... my strategy knows when an indicator signal is in the chart but it doesn't know how to filter when that signal appears, so it does a loop of entries.
    If I can filter an entry by the tag, that may solve the problem. I tried it with DrawObjects["someTag"] but it doesn't work.
    Regards, MEVG.

    #2
    Hello MEEVG,

    To use an indicator as a signal you would generally make an indicator that produces a plot. The plot could be used as a signal with no loops.

    You also mentioned draw objects here so I am not completely sure what you made at this point. The best example that I could suggest would be the SMA and how it sets a Plot. That plot can be used in a strategy to form price conditions with the SMA.

    If you can provide more specifics on what you made in the indicator to expose the signal that would help to provide more guidance here.

    I look forward to being of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello MEEVG,

      To use an indicator as a signal you would generally make an indicator that produces a plot. The plot could be used as a signal with no loops.

      You also mentioned draw objects here so I am not completely sure what you made at this point. The best example that I could suggest would be the SMA and how it sets a Plot. That plot can be used in a strategy to form price conditions with the SMA.

      If you can provide more specifics on what you made in the indicator to expose the signal that would help to provide more guidance here.

      I look forward to being of further assistance.
      foreach (DrawingTool draw in DrawObjects)
      {
      if (draw is DrawingTools.Square && Close[0] > Open[0])
      {
      DrawingTools.Square thisSquare = draw as DrawingTools.Square;
      EnterLong("Prueba");
      }

      I did something like that, that works, but it entry in a loop. I want to know how I can say "if a square appears into the chart, do an entry, but only one time per square". So... if one square appears, do an entry, but when it hit a stop or a profit, please wait to another square to do another entry.
      Thanks for your help.
      MEVG.

      Comment


        #4
        Hello MEVG,

        This is Jim responding on behalf of Jesse who is out of the office at this time.

        As Jesse mentions, it is best to use a Plot in an indicator, and have the strategy read that Plot to see if an action should be taken.

        You could consider tracking a List<string> which tracks each drawing object's tag, or other components of the drawing object, so the script can recognize if those objects were already found. If the DrawingObject is found and is in your List, then you can ignore submitting an order.

        Tracking objects in a List could also be used to see how many objects are drawn at a certain time if you wanted to wait for an other object to appear before taking additional actions.

        As you may see, this can start to get complicated, where it may be easier to ad a plot in an indicator and use the plot to signal if a buy/sell should be made.

        Publicly available information on Lists can be found here - https://docs.microsoft.com/en-us/dot...tframework-4.8

        Comment


          #5
          I have an other idea to do this more simple. I can filter all with a function that do this: If an Square appears in the current bar, entry. I wanna do an automatic system for indicators that makes signals, I can't do the plot because I don't have acces to the code because it's for 3rd party indicators.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          54 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          131 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          73 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          44 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X