Breakeven stoploss

Specifiche

Hello


The code below is for moving stop loss to breakeven after price has moved a certain amount of pips past OrderOpenPrice.

i.e Sell trade - move stop to 4 pips below breakeven when price has moved 7pips + 4pips below breakeven.


My trade entry is set to open of a candle but due to slippage OrderOpenPrice is not always at candle open. I need the code below altered to include slippage or to move stoploss at candle open not OrderOpenPrice



void TrailingStopBE(int type, double profit, double add) //set Stop Loss to open price if in profit

  {
   int total = OrdersTotal();
   profit = NormalizeDouble(profit, Digits());
   for(int i = total-1; i >= 0; i--)
  rderOpenPrice() + add, 0);   {
      while(IsTradeContextBusy()) Sleep(100);
      if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
      if(OrderMagicNumber() != MagicNumber || OrderSymbol() != Symbol() || OrderType() != type) continue;
      RefreshRates();
      if((type == OP_BUY && Bid >  OrderOpenPrice() + profit && (NormalizeDouble(OrderStopLoss(), Digits()) <= 0 || OrderOpenPrice() > OrderStopLoss()))
      || (type == OP_SELL && Ask < OrderOpenPrice() - profit && (NormalizeDouble(OrderStopLoss(), Digits()) <= 0 || OrderOpenPrice() < OrderStopLoss())))
         myOrderModify(OrderTicket(),O

     }


TrailingStopBE(OP_BUY, 90 * myPoint, 0 + 40 * myPoint); //Trailing Stop = go break even + fixed value

   TrailingStopBE(OP_SELL, 90 * myPoint, 0 - 40 * myPoint); //Trailing Stop = go break even - fixed value

Con risposta

1
Sviluppatore 1
Valutazioni
(63)
Progetti
68
25%
Arbitraggio
12
42% / 42%
In ritardo
4
6%
Gratuito
2
Sviluppatore 2
Valutazioni
(21)
Progetti
23
0%
Arbitraggio
6
17% / 83%
In ritardo
2
9%
Gratuito
3
Sviluppatore 3
Valutazioni
(879)
Progetti
1392
67%
Arbitraggio
117
32% / 42%
In ritardo
215
15%
Gratuito
4
Sviluppatore 4
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
5
Sviluppatore 5
Valutazioni
(1)
Progetti
2
0%
Arbitraggio
3
0% / 100%
In ritardo
0
Gratuito
6
Sviluppatore 6
Valutazioni
(303)
Progetti
384
20%
Arbitraggio
43
60% / 23%
In ritardo
45
12%
Occupato
7
Sviluppatore 7
Valutazioni
(169)
Progetti
204
30%
Arbitraggio
25
40% / 44%
In ritardo
12
6%
Gratuito
8
Sviluppatore 8
Valutazioni
(596)
Progetti
928
46%
Arbitraggio
31
39% / 29%
In ritardo
93
10%
Gratuito
9
Sviluppatore 9
Valutazioni
(23)
Progetti
23
57%
Arbitraggio
2
50% / 0%
In ritardo
0
Gratuito
10
Sviluppatore 10
Valutazioni
(37)
Progetti
37
24%
Arbitraggio
0
In ritardo
0
Gratuito
11
Sviluppatore 11
Valutazioni
(126)
Progetti
151
48%
Arbitraggio
6
83% / 17%
In ritardo
2
1%
Gratuito
12
Sviluppatore 12
Valutazioni
(15)
Progetti
17
6%
Arbitraggio
1
0% / 100%
In ritardo
1
6%
Gratuito
13
Sviluppatore 13
Valutazioni
(196)
Progetti
318
35%
Arbitraggio
64
13% / 56%
In ritardo
82
26%
Gratuito
14
Sviluppatore 14
Valutazioni
(34)
Progetti
60
23%
Arbitraggio
11
73% / 9%
In ritardo
3
5%
Gratuito
15
Sviluppatore 15
Valutazioni
(3)
Progetti
4
0%
Arbitraggio
1
100% / 0%
In ritardo
0
Gratuito
16
Sviluppatore 16
Valutazioni
(42)
Progetti
49
47%
Arbitraggio
1
100% / 0%
In ritardo
1
2%
Gratuito
Ordini simili
Life Creator 40 - 1000 USD
the topic of this robot is ,,life creator'' becouse when you have no idea what to do, this robot can help you and teach you how you can do it. The robot gonna creat you your own tactics which can help you in future. When you gonna see that it's really work you start to be happy and you gonna want to have more of this
I need ea that based on point and finger chart formula point and finger chart does not follow time frame only price based and point and finger chart has same functions as given below source > HL/close box size assignment method > traditional reversal > 1 or given as request box size > 0.00 lot size > 0.00 trailing stop in box > one box behind or as given must not follow time only price based X
I need the following modules as per this sample indicator, then integrated with RSD Candles. look into the sample input settings, ................................................. ......................................................................................................... .......................................................................................................... ................previous
You need to be able to convert the IBS Indicator which is written like this in ProRealCode: r = max(range,0.0001) ibs = (close-low)/r Also, you need to be able to convert the Momentum indicator written like this in ProRealCode: https://www.prorealcode.com/documentation/momentum/ Return value of the Momentum technical indicator of the Nth bar : (close – close of the N-th last bar). 1 Momentum [ N ] Calculation: It is
Hft live account 30 - 200 USD
i need a high frequency trading (hft) expert advisor, that can be used to trade on demo and live accounts icmarket and 8cap. The EA has to be highly profitable, giving daily profit. If a test version is available, please send, to foster a faster transaction. like the ones that pass prop firm and demo but adjustment where it work on live with low latency
Hello [Programmer's Name], I hope this message finds you well. I am seeking your expertise to develop a forex Expert Advisor (EA) capable of identifying trading opportunities based on crossover signals from the following indicators: - MACD - RSI (including Connor RSI) - Stochastic RSI - Stochastic - Moving Averages (MA) with periods: 5, 10, 20, 50, 100, and 200 Key requirements for the EA include: - Integration of
Hello, i need a robot for gold trading being able to determine a trend or instant changes on a micro scale so its just going to scalp very fast but, for example lets say we have an equity of 500 bucks it needs to take profit at 5 and open a new position and just continiue going like that all day, but i also want it to determine buying opportunities based off of a very wide range of candlestick data of gold the day
CPI ROBOKING 30+ USD
*Strategy: CPI-Based Trading* *Instruments:* XAUUSD (Gold), UsTech100 (Nasdaq 100), USDJPY *CPI Release:* 1. *Higher-than-expected CPI:* - XAUUSD: SELL (Gold prices may drop due to potential rate hike) - UsTech100: SELL (Tech stocks may drop due to potential rate hike) - USDJPY: BUY (USD may strengthen due to potential rate hike) 2. *Meets or lower-than-expected CPI:* - XAUUSD: BUY (Gold prices may rise due
Hello, I have an EA already created and what I require is a modification to the code so that when a backtest is executed, it generates a CSV file with custom data that I want to extract to perform an analysis of the backtest operations
Create mt4 ea 50+ USD
To convert the provided MT4 indicator script into an Expert Advisor (EA) and implement prompt functionality for user input, we need to modify the code to handle external parameters and provide a user-friendly interface. Below is the EA code that incorporates prompts for user inputs

Informazioni sul progetto

Budget
30+ USD
IVA (23%): 6.9 USD
Totale: 36.9 USD
Per lo sviluppatore
27 USD