Trailing Stop level indicator

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

Trailing Stop level indicator

Postby Alexander.Gettinger » Wed Oct 09, 2013 11:29 am

The indicator can be used to calculate the stop levels for trading.

Formulas:
TSL[i] = Max(TSL[i-1], Close[i]-loss), if Close[i]>TSL[i-1] and Close[i-1]>TSL[i-1],
TSL[i] = Min(TSL[i-1], Close[i]+loss), if Close[i]<TSL[i-1] and Close[i-1]<TSL[i-1],
TSL[i] = Close[i]-loss, if Close[i]>TSL[i-1],
TSL[i] = Close[i]+loss, if Close[i]<TSL[i-1], where
loss = Close[i]*Percent/100.

Trailing_Stop_Level.PNG


Download:
Trailing_Stop_Level.lua
(2.14 KiB) Downloaded 632 times

Trailing_Limit_Level.lua
(3.68 KiB) Downloaded 38 times

Trailing_Stop_Level.lua based strategy.
viewtopic.php?f=31&t=66878
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3342
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

Re: Trailing Stop level indicator

Postby tmdabc » Fri Oct 23, 2015 2:30 pm

looks good,thanks :!:
tmdabc
 
Posts: 19
Joined: Sat Oct 17, 2015 11:12 am

Re: Trailing Stop level indicator

Postby Apprentice » Tue Oct 23, 2018 6:36 am

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

Re: Trailing Stop level indicator

Postby Phamilton630 » Fri Oct 26, 2018 7:36 am

Is there any way to incorporate a limit/take profits line into this indicator also?
Phamilton630
 
Posts: 23
Joined: Mon Feb 12, 2018 12:10 pm

Re: Trailing Stop level indicator

Postby Phamilton630 » Fri Oct 26, 2018 11:38 am

If a take profit (TP) line component can be added to this indicator, it would then be possible to add a profit loss counter to the top right corner of the chart.

It would measure the pips accumulated in the chart by the continuous SL and TP events.

This would allow the operator to fine tune TP & SL levels to maximise profits and minimise losses

thank you
Phamilton630
 
Posts: 23
Joined: Mon Feb 12, 2018 12:10 pm

Re: Trailing Stop level indicator

Postby Apprentice » Sat Oct 27, 2018 5:17 am

How we will calculated limit/take profits line?
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 19865
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trailing Stop level indicator

Postby Phamilton630 » Sun Oct 28, 2018 1:52 pm

simplest case would be to make it equal but opposite to SL amount of pips
Phamilton630
 
Posts: 23
Joined: Mon Feb 12, 2018 12:10 pm

Re: Trailing Stop level indicator

Postby Apprentice » Mon Oct 29, 2018 6:08 am

Trailing_Limit_Level added.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 19865
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trailing Stop level indicator

Postby Phamilton630 » Mon Oct 29, 2018 10:06 am

ah ok TP never gets hit. Silly me.

Could you please turn the SL indicator into a strategy that can open a trade when SL is hit (a trade in the opposite direction).

Three trade modes
> trade longs only
> trade shorts only
> trade longs & shorts (continuous trading, opposite trade entered when previous trade closed)
Phamilton630
 
Posts: 23
Joined: Mon Feb 12, 2018 12:10 pm

Re: Trailing Stop level indicator

Postby Apprentice » Tue Oct 30, 2018 4:18 pm

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

Next

Return to Custom Indicators

Who is online

Users browsing this forum: No registered users and 18 guests