Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Condition Builder question

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

    Condition Builder question

    Hi,
    I'm trying to have triangles drawn (and stay) on my chart when certain conditions are met.
    I've had success drawing vertical lines but can't get triangles to show above/below the bars. Here's the code that draws lines but not triangles.
    (There are no triangles showing in the double click -> Drawing Objects window. And no errors showing on the log.)
    Thanks.


    Click image for larger version

Name:	triangles.png
Views:	101
Size:	28.9 KB
ID:	1269880



    Attached Files

    #2
    Hello manraygun,

    Thank you for your post.

    When selecting the action to draw a Triangle Up in the Strategy Builder, what the script is doing is calling the method Draw.TriangleUp() which includes a selection for the y value on the y-axis (Price axis) where you would like the object to be drawn:


    I see that you have 0 selected; this would draw the Triangle Up at a price of 0. If you want a triangle above/below the bar, you could click 'set' in the Y edit box and choose a value that is the bar's High with a positive offset or the bar's Low with a negative offset. For example, this triangle would be drawn at the High of the current bar plus 5 ticks:For more information on offsetting an item value, please see that section of the condition examples here:


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

    Comment


      #3
      I have another question please....
      When trying to run a strategy from say 8PM to 4AM the next day, it doesn't work using the TimeOfDay coding as shown below.
      It seems that when the end time is earlier than the start time, there's a contradiction of some sort. Is there a way to fix this?
      Or perhaps I should somehow set the strategy to run 24 hours, and specify a time period when the strategy should NOT run, say 4AM to 8PM?
      Thank you.


      Click image for larger version  Name:	times.png Views:	0 Size:	14.4 KB ID:	1269889
      Last edited by manraygun; 09-21-2023, 01:36 PM.

      Comment


        #4
        Thanks for the help, Emily.

        Comment


          #5
          Originally posted by manraygun View Post
          I have another question please....
          When trying to run a strategy from say 8PM to 4AM the next day, it doesn't work using the TimeOfDay coding as shown below.
          It seems that when the end time is earlier than the start time, there's a contradiction of some sort. Is there a way to fix this?
          Or perhaps I should somehow set the strategy to run 24 hours, and specify a time period when the strategy should NOT run, say 4AM to 8PM?
          Thank you.


          Click image for larger version Name:	times.png Views:	0 Size:	14.4 KB ID:	1269889
          Sure thing, I'm glad to help! For the StartTime and EndTime, if you had StartTime set to 8pm and EndTime set to 4am, the conditions in your screenshot should work as expected. Please go to the Inputs and Variables screen and double check the values set for StartTime and EndTime and be sure the type Time is selected and also that they are set to the expected values. The link in my previous post to a page of conditions examples also has a "How to create time filters" example that you could try using hard-coded values as a test. Then, you could switch to an input or variable for the time and test again to ensure it works as expected.

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

          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