[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Applystop in the dark



PureBytes Links

Trading Reference Links

Dear Tz,
I have collected the information for applystop and I have some 
contradictions for the differents modes,
you have written:
***************************


Here is corrected version:
- trade is entered at BuyPrice (may be close depending on your 
settings)
- in mode 1 (point loss) stop exits the trade when Low < 
HighestPriceSinceBuy - StopAmount 
- in mode 2 (percent loss) stop exits the trade when ( Low / 
HighestPriceSinceBuy ) < 1 - PercentAmount
- in mode 3 (percent of profit) stop exits the trade when 
PercentAmount of highest profit since trade

SYNTAX applystop( type, mode, amount, exitatstop ) 
RETURNS nothing 
FUNCTION controls built-in stops from the formula level
(allows optimization of stops)


Parameters: 
TYPE = 0 - maximum loss stop, 1 - profit target stop, (more to be 
added)
MODE = 0 - disable stop, 1 - amount in percent, 2 - amount in points
AMOUNT = percent/point loss/profit trigger amount
EXITATSTOP = 0 - exits at defined price field, 1 - exits at stop 
level 

*******************************
**************NOW IF I WANT *******************

1/ if I want A stopLOSS in PERCENTAGE
type=0;/*0 - maximum loss stop*/
mode=1 OR 2;/*CONTRADICTION: 1 - amount in percent OR mode 2 (percent 
loss)*/
amount=optimize( "loss stop level", 10, 2, 30, 1 );
Exitatstop=1;

2/if I want a stopLOSS in POINT (ATR)
type=0
mode=1 or 2 /* CONTRADICTION: 2 - amount in points OR mode 1 (point 
loss)
*/
amount= factor*ATR(value);
Exitatstop=1;

3/if I want a profitTARGET in PERCENTAGE
type=1;/*1 - profit target stop*/
mode= 1 OR 3 /*CONTRADICTION: 1 - amount in percent OR 3 (percent of 
profit)*/
amount=optimize( "profit stop level", 10, 2, 30, 1 );
Exitatstop=1;

4/if I want a profitTARGET in POINT ( ATR)
type=1;
mode= 2 or WHAT /* 2 - amount in points*/
amount= factor*ATR(value);
Exitatstop=1;



Stephane