CRUDE NNFX ATR MODIFIER FOR STOP/PROFITS
-
NNFX ATR MODIFIER
If you are looking to calculate your risk and profits using the ATR and want profit and stop orders place when you buy this is how you accomplish it
Notes:
MAKE SURE YOUR CANDLE ID IS SET TO 1
Other code:
double ATR = (iATR(NULL,0,14,0)); // TELLS THE ATR OF THE 1H ADDED TO THE BID
double STOPLOSS = ((Bid - ATR) +0.00001);
double TAKEPROFIT = ((Bid + (ATR*5) +0.0000);P.s only took me about 35 versions
FRAZ
clickable example link
https://fxdreema.com/shared/FDHljQ39b -
CLARIFICATION
This will set your STOP/PROFIT TARGETS to the previous candles ATR range ONLY at the time of contract purchase.
This will not update and is not a trailing stop. This is a Fixed OCO Order.
Math:
Purchase price - ATR value = STOP
Purchase price + ATR value = TARGETexample:
1.0000 - 0.0063 (63 pips) = 0.9937 (STOP ORDER)
-
UPDATE:
Messing around with formulas and variables to create a "shadow order." for ATR. Due to experiencing an issue of not being able to only sell a partial order from the hard coded "takeprofit". want to sell a portion at 1x ATR to lock in profits and move stops
will update with what i find later.
Theory: you can use formulas to update variables to create "shadow orders" that "on tick" check the current price to see if there is a BOOL value to execute an order.
FRAZ