Announcement

Collapse
No announcement yet.

TAG function?

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

  • TAG function?

    Hi
    I am having a hard time trying to get the TAG functions to work right in my indicator. Can someone help me out?

    Thanks,
    chris
    Attached Files

  • #2
    Chris

    The way the tags are coded in your efs will plot the shape only on the last bar in which the corresponding condition verifies as true.
    If instead what you want to do is:

    a) show the shape on every bar in which the condition verifies as true then leave out the tag at the end.
    For example onAction1 would be written as follows

    drawShapeRelative(0, high(), Shape.SQUARE, "", Color.lime, Shape.LEFT);

    b) show the shape only on the first bar in which the condition verifies as true then you need to add if (vLastAlert != X) where X is the number of the corresponding onAction function.
    For example onAction2 would be written as follows

    if (vLastAlert != 2)drawShapeRelative(0, low(), Shape.SQUARE, "", Color.red, Shape.LEFT);

    if you want to show it every first time or as follows

    if (vLastAlert != 2)drawShapeRelative(0, low(), Shape.SQUARE, "", Color.red, Shape.LEFT,2);

    if you want to show it only the first time of the last occurrence.

    Lastly there is one condition ie vCCI13_of_HLC3.getValue(CCIStudy.CCI) > 100 which is not plotting any shape.
    I suspect that this is due to the fact that when that condition is true one of the conditions that precedes it is also true hence it gets overridden.
    To verify this you may want to plot all the indicators you have so as to check if that is the case.

    Alex
    Last edited by ACM; 10-02-2003, 02:59 AM.

    Comment


    • #3
      Thanks for you reply Alexis. I have been playing around with how I could setup the indicator to be easy to use. In the end I have decided to try to use a paint bar and a shape relative instead of two shape relatives. I am having a problem trying to get the paint bars and shape relative to display properly. It seems like it will only paint the bars when the shape relative is not present. I currently have the two setup in seperate indicators. Can someone suggest how I might be able to put them in the same indicator? I have attached the indicator on this post and the next. An ideas would be greatly appreciated.

      Thanks,
      chris
      Attached Files

      Comment


      • #4
        The adx paint bar indicator.
        Attached Files

        Comment


        • #5
          Chris
          As is now the cciadx.efs does not paint the bars when the conditions in Set1 or Set2 are not true (actually it paints them in white when neither condition is true and in black when one of them verifies)
          Try adding a Set3 where if (1==1) - which is always true by definition - it will paint the bars in black every time this happens.
          Then combine the two efs again and see if this changes anything.
          Alex

          Comment


          • #6
            Alex,
            That's great, that fixed the adx paintbar problem I was having. But the plots are not displaying at all now. When you get a chance could you take a look? Or if you have any ideas I can try that would be great.

            Thanks,
            chris
            Attached Files

            Comment


            • #7
              Chris
              The problem is caused by the fact that you have the 1==1 condition as Set3 so once the script has verified the first two Sets as not true it finds 1==1 which is always true and stops verifying any further.
              Delete the current Set3 and add the 1==1 condition as the very last one (will be the new Set5).
              I believe it should work
              Alex

              Comment


              • #8
                Thanks Alex. That worked great. If anyone wants to check the this indicator here it is.

                chris
                Attached Files

                Comment

                Working...
                X