ATR Stop Dots

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

ATR Stop Dots

Postby igillman » Sun Feb 14, 2016 5:31 pm

atr_stop_dots.jpg


This is an indicator that I have written which is based on code from lots of other indicators. I have never written LUA code before so it might not be as clean as it should be but it does the job. It allows you to see where to place stops and how many lots you can buy/sell in order not to go over a certain percentage risk for the trade. Almost everything is adjustable including the risk percentage, ATR multiplier and profit multiplier.

A lot of people will place their stops at 1.5x the current ATR value in order to avoid getting stopped out but they do not want to risk more than 1% of their account on any one trade. This indicator will place a red dot above and below the closing value of a candle which represents either 1.5x ATR or 1% risk level whichever is less. It also places a blue dot at twice the distance so that you can see the 2:1 risk ratio point for the trade. I use the blue dots to eyeball the size of the channel to see if it is worthwhile trading and the red dots to place my stops.

The indicator will also show the distance in pips to the red dots (below the candle) and the number of lots you can trade and still stay under 1% (above the candle). The number of pips is useful to set trailing stops and the lot size does the calculation for you to enable you to maximise the trade without risking more than you want to risk.

All of the numbers and colours are adjustable parameters so you could have 2x ATR and 3% risk with a 1.5x profit target if you wanted. The ATR parameters are also adjustable so you can use the last 14 days or 5 days or anything you want. You can also specify if you want it over just one candle or multiple candles to spot trends. The ability to have it over the last candle (still forming) is also a parameter.

I find it very useful for me, I hope someone else finds it useful as well.

ATR_Stop_Dots.lua
(4.21 KiB) Downloaded 610 times

MT4/MQ4 version.
viewtopic.php?f=38&t=68583
igillman
 
Posts: 3
Joined: Mon Jan 25, 2016 10:14 pm

Re: ATR Stop Dots

Postby Apprentice » Thu Aug 24, 2017 8:53 am

The indicator was revised and updated.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 22078
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: ATR Stop Dots

Postby spinemaligna » Fri Jan 19, 2018 4:13 pm

Hi Apprentice,

I am amazed no one has requested a strategy to be based on this indicator so here goes.
The rules are:
The strategy runs in the background and on detecting a new open position will place stop and limit values based on the position of the red and blue dots of the previous candle. An option to trail the stop will be offered. The lot size will be governed by the value returned from the indicator.

Thanks

Ross
spinemaligna
 
Posts: 79
Joined: Sun Sep 12, 2010 2:42 am

Re: ATR Stop Dots

Postby Apprentice » Sat Jan 20, 2018 3:18 pm

Your request is added to the development list under Id Number 4013

The lot size will be governed by the value returned from the indicator.

We can not do this bit.
The position size cannot be adjusted after the position is open.
We have to implement this logic in a particular strategy.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 22078
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Re: ATR Stop Dots

Postby spinemaligna » Mon Jan 22, 2018 6:09 am

Great work,

Testing now.

Many thanks
spinemaligna
 
Posts: 79
Joined: Sun Sep 12, 2010 2:42 am

Re: ATR Stop Dots

Postby minifire18 » Fri Jun 14, 2019 11:42 am

Apprentice
Can you code for MT4
thanks
minifire
minifire18
 
Posts: 30
Joined: Tue Dec 11, 2018 8:43 am

Re: ATR Stop Dots

Postby Apprentice » Mon Jun 17, 2019 7:37 am

Your request is added to the development list under Id Number 4727
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 22078
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia



Return to Custom Indicators

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 11 guests