Announcement

Collapse
No announcement yet.

Background color change

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

  • Background color change

    Could someone help me on this efs..

    Since I have gotten the alert sounds working now I can start to tweak some of these efs's to my needs..

    What I would like to have done with this efs is to have the background color change to lime on a stoch crossing up and red when crossing down..

    I would like this to happen at the time of crossover without delays..The arrows actually do this and will flicker on or off and even go from up to down if the stoch is volitale..

    I have found that this efs is super if working with stoch crossovers and the screen chart background color changes would add real visual aids to it if watching stoch's in different time frames..ie 1 minute and a 20T chart trading only if both are in alignment, same BG color..

    Also, if the audio alert would fire at the time of crossover also, but that I think I can figure out..

    Another question, related but not on this efs, can the same efs work on a Jurik efs??

    Thanks in Advance!!

    Racer
    Attached Files

  • #2
    Racer
    I am not sure if you want the whole background of the chart to be painted in lime/red or just the bar at the crossover points or also all the bars that follow.
    In the first case I think I may have already posted an example for you that does that. Run a Search on your own messages and you should find it. If not then replace the commands I have added to your efs ie setBarBgColor(Color.lime); and setBarBgColor(Color.red); with setChartBG(Color.lime); and setChartBG(Color.red); respectively.
    In the second case the attached revision adds the background color on Stochastic crossings. The added lines are commented.
    For the latter option the command and conditions to color the background will have to be written in a slightly different way.

    FYI the audio alert is set to trigger once a bar is closed so as to avoid false intrabar signals. If you want it to play a sound every time a cross happens (even intrabar) then just move the commands from where they are now to the set of conditions that run in real time (ie where the arrows and background color are set)
    Alex
    Attached Files

    Comment


    • #3
      Alex:

      Again I must say thank you!!..

      Not being a programmer, although I did go to school for it years ago, I find it hard to do and my explaination of what I would like to see may be short of what I would like..

      I would like to see the complete background of the chart change at time of cross, like your background.efs that you were so kind to share with us..You are using a pink, cross down and a pale green for the cross up..these I can change from the lime/red..If the signal is false, the stoch uncrosses interbar, the chart background will revert to the prior color..

      Also, the audio alert I would like to sound at point of the cross, this being done only to bring my attention to the chart(s) to check for alignment between the two..I have found that in my trading style, I use the tick chart to find a trade, but I actually use the 1 min chart to enter the trade..Thus the need for complete background change..both the same, the trade has a better chance of being good..

      Again many thanks, you can not believe how mush your help is appreciated!!!

      Racer

      Comment


      • #4
        Racer
        To change the background color as soon as a cross occurs (even intrabar) add the following commands after line 100 of the efs

        PHP Code:
        if(vStoch.getValue(StochStudy.FAST)>vStoch.getValue(StochStudy.SLOW))
                
        setChartBG(Color.lime);
            
        if(
        vStoch.getValue(StochStudy.FAST)<vStoch.getValue(StochStudy.SLOW))
                
        setChartBG(Color.red); 
        Consider though that the response time in coloring the background of the whole chart is not as immediate as that of a single bar background or that of drawing an object on the chart.

        As to the sound alert all you need to do is to move it out from under the getBarState()==BARSTATE_NEWBAR condition and place it in the real time cross conditions just below.

        At this point I believe you should have enough examples and information available to you to be able to modify this efs to your exact needs.
        Alex

        Comment


        • #5
          Alexis...Thank You, Thank You, Thank You!!!

          I have attached the completed efs to share with anyone that may like to have it..The alerts fire at time of crossover and the background color of the chart changes to a pale green for the fast crossing up and to pink when the fast is crossing down..Also the alert will fire at the time the arrow is placed and yes Alex is correct, the BG is a little slower than the arrow, but not by much..

          Remember that your stoch settings may have to be changed/adjsuted, on the stock I am working with, 8,5,3 is almost right on the money, but I have found this is not a universal setting as you really know..

          I will use this efs on 3 charts, a 75T, a 25T and a 1 minute chart only taking a trade when all 3 are the same color and start looking for an exit when the color of one of the Tick charts goes against the trade..

          Many thanks Alex again..Now hopefully I can use this on other efs's to suit my needs..

          Racer
          Attached Files
          Last edited by sc1317; 05-16-2004, 01:22 PM.

          Comment


          • #6
            A side note on the BG efs..

            Appears that the alarm portion of the efs does not work as desired..It fires an alarm on every trade on the bar and when the arrow is placed..I only checked it via bar replay and not tick replay..Sorry..I have been trying to fix it all this morning to no avail..

            Maybe someone can help us with this small problem..

            Audio alarms should only fire once at crossover and not on everytrade..

            I'm attaching an efs that in fact I have found turns the audio and visual alarms off..

            On lines 75 & 80 I removed the -1 from the fast and slow..the colors and arrows still work, but the sound and popup will not..

            These appear to be the lines in which the alarms will work, but for the life of me I can not figure it out..

            The EFS is super if trading the stoch's and actually can be used with out the popup and sounds, although they would be a cool feature..

            Again many thanks..

            Racer
            Attached Files

            Comment


            • #7
              Racer

              Appears that the alarm portion of the efs does not work as desired..It fires an alarm on every trade on the bar and when the arrow is placed

              That is correct. With those changes it will trigger at every intrabar crossover (in either direction) for the duration of that bar.
              That is the reason why I had originally set the alerts to trigger only when the crossover was confirmed ie at the very first tick of a new bar. This was defined by the condition if(getBarState()==BARSTATE_NEWBAR)

              Audio alarms should only fire once at crossover and not on everytrade..

              The issue is what constitutes a crossover? The Stochastic could do one or more intrabar crossovers but then end up not being crossed at the close of the bar. Again this is the reason for having set up the alerts the way I did in my original efs.
              Alex

              Comment

              Working...
              X