1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FTS Toolkit - Sticky Trends - Draw trend lines easier by holding Ctrl

Discussion in 'Forex Tactical Squad' started by Peter O, Jul 8, 2013.

  1. Peter O

    Peter O Special Consultant to the FPA

    Joined:
    Jan 14, 2013
    Messages:
    3,247
    Likes Received:
    1,397
    Fellow Squad Members,


    Another code I'd like to share with you is a quite special one. I used to spend some time with 'convenience codes' and not only with EAs and indicators or market data analysis. This kind of tools mostly makes**trading platform*more handy by providing common function with fewer clicks or shinier display. I just refurbished this code that simply helps drawing trend lines. If your trading and chart handling habits work with trend lines you can find it quite convenient. And it is a quite good source of mql tricks.


    Installation and starting:

    Download source code from here:


    This is an EA code so you need to copy it to {MetaTrader4 folder}/experts/ folder and then start the trading platform (or close and restart if it had been open). The tool will appear on Navigator panel (open from View menu) among Expert Advisors as FPA=StickyTrends so just drag over your chart.

    [​IMG]

    Enable Expert Advisors:

    To use it don't forget to enable Expert Advisors in terminal's Options (menu: Tools/Options - Expert Advisors tab first checkbox). This shows a smiley face on the upper right corner next to the EA's name (otherwise there is an x).

    [​IMG]
    [​IMG] [​IMG]

    Settings and Parameters:

    By technical reasons you can open Inputs tab only right after starting EA when Properties come up. Switch from Common tab to Inputs.

    [​IMG]

    Parameter: Show_Proximity_Circle
    Possible values: true, false

    Parameter: Proximity_Distance_Pixels
    Possible values: positive integer

    Stickiness helps you selecting highs and lows on the chart. This tool simply starts drawing trend lines from the closest high or low in a circle around the mouse cursor. First parameter tells the EA that you want to see that circle and the second one defines the radius of that circle.


    Operation:

    Everything works as normal on the chart but as soon as you hold down the Control key trend line drawing starts. First you can select the starting point:


    [​IMG]


    ---––– After this step –––---
    Release Ctrl: quit drawing - removes all objects
    Single left mouse click: start selecting endpoint


    [​IMG]


    ---––– After this step –––---
    Release Ctrl: stop drawing - trend line remains
    Single left mouse click: start adjusting line length


    [​IMG]


    ---––– After this step –––---
    Release Ctrl: stop drawing - trend line remains
    Single left mouse click: start placing parallel line


    [​IMG]


    ---––– After this step –––---
    Release Ctrl: finish drawing - trend lines channel remains
    Single left mouse click: finish drawing - trend lines channel remains


    ---––– Whenever you've drawn a trend line –––---
    Press Esc: delete last line (works for several seconds)​


    You can participate:

    Tell me and your Squad Members how you like it.
    Tell me and your Squad Members how could it be better.
    Tell me and your Squad Members if you have any problem while installing or using it.


    Who wants to enter the Laboratory:

    Right click on Navigator panel/Expert Advisors/FPA=StickyTrends and select Modify. MetaEditor opens up showing the full source code I've written for you.

    [​IMG]

    On the first screen you can find some hidden parameters like colors and styles (from line "color proximity_circle_color = ..." to "double horiz_vertic_sticky_angle = ...". You can change the values after the equal sign (you can use these color names just write them without spaces and be aware of case sensitivity) and even the default setting "true" and "39" above them for the input parameter "extern bool Show_Proximity_Circle = ..." and "extern int Proximity_Distance_Pixels".

    [​IMG]

    After modifying the code press F5 or Compile button on the top. If it writes "0 error(s),..." on the bottom, you have your own new version and you can start using it after going back to MT4 terminal.

    [​IMG]

    Looking forward to hearing your feedback,

    Peter
     
    #1 Peter O, Jul 8, 2013
    Last edited: Mar 19, 2015
  2. shafiekd

    shafiekd Recruit

    Joined:
    Jun 11, 2013
    Messages:
    1
    Likes Received:
    0
    Hi Peter

    This tool looks great, but I cannot attach it to any charts. I even tried 3 different MT4 platforms, but same thing.
    Shows up under expert advisors and I can right click and modify, but nothing appears when attaching it to the chart.

    Thansk
     
  3. Peter O

    Peter O Special Consultant to the FPA

    Joined:
    Jan 14, 2013
    Messages:
    3,247
    Likes Received:
    1,397

    Does the EA's name appear in the upper right corner together with the smiley face? I know that even if it does the terminal must be online otherwise MT4 doesn't start any EA even if it could. For example if your platform is offline ('No connection' in the lower right corner) you can't use this tool even on an offline chart but as soon as it gets online EA starts working.

    I just tried it on two different MT4s and it started working at the moment I held down the control key.
     
  4. bilkisakt

    bilkisakt Recruit

    Joined:
    Jul 25, 2013
    Messages:
    7
    Likes Received:
    0
    Good to know that and thanks for your information . Now I can also do this
     
  5. jessyodion

    jessyodion Recruit

    Joined:
    Oct 15, 2012
    Messages:
    6
    Likes Received:
    0
    link to get tool for drawing sticking trends

    please i want the link through which i can get these EA.
     
  6. Peter O

    Peter O Special Consultant to the FPA

    Joined:
    Jan 14, 2013
    Messages:
    3,247
    Likes Received:
    1,397
  7. Peter O

    Peter O Special Consultant to the FPA

    Joined:
    Jan 14, 2013
    Messages:
    3,247
    Likes Received:
    1,397
    I tested all source code links and eventually I replaced all of them because I saw downloading issue in Firefox.

    Now I've tested new links and all worked fine for me in Firefox and Chrome as well.

    Peter
     
  8. Florian P

    Florian P Recruit

    Joined:
    Jul 29, 2014
    Messages:
    5
    Likes Received:
    1
    ... Just spent 30 minutes on rewriting the code because I couldn't attach it to a chart in built 670 MT4.

    It said Expert FPA=StickyTrends is not expert and cannot be executed.

    The last and only thing I would have had to change was the 3rd line of code:

    #property show_inputs

    change to

    //#property show_inputs

    and it can be attached. At least in my 670.

    Thank you and best regards,
    Florian
     
  9. Peter O

    Peter O Special Consultant to the FPA

    Joined:
    Jan 14, 2013
    Messages:
    3,247
    Likes Received:
    1,397
    Hi Florian, I commented out the code line on the server so that to avoid problems with 670. Thanks! Peter
     
  10. gowtham

    gowtham Recruit

    Joined:
    Mar 16, 2015
    Messages:
    1
    Likes Received:
    0
    sign mismatch FPA=StickyTrends.mq4 319 94
    sign mismatch FPA=StickyTrends.mq4 338 65
    not all control paths return a value FPA=StickyTrends.mq4 525 3
    not all control paths return a value FPA=StickyTrends.mq4 533 3
    declaration of 'cursor_candle_index_prior' hides global declaration at line 77 FPA=StickyTrends.mq4 631 8
    declaration of 'cursor_price_prior' hides global declaration at line 79 FPA=StickyTrends.mq4 632 11


    Its showing these 6 warnings and this cannot be attached with any of my charts. Please help me with this.
     

Share This Page