Breakeven stoploss

Termos de Referência

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

Respondido

1
Desenvolvedor 1
Classificação
(63)
Projetos
68
25%
Arbitragem
12
42% / 42%
Expirado
4
6%
Livre
2
Desenvolvedor 2
Classificação
(21)
Projetos
23
0%
Arbitragem
6
17% / 83%
Expirado
2
9%
Livre
3
Desenvolvedor 3
Classificação
(879)
Projetos
1392
67%
Arbitragem
117
32% / 42%
Expirado
215
15%
Livre
4
Desenvolvedor 4
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
5
Desenvolvedor 5
Classificação
(1)
Projetos
2
0%
Arbitragem
3
0% / 100%
Expirado
0
Livre
6
Desenvolvedor 6
Classificação
(303)
Projetos
384
20%
Arbitragem
43
60% / 23%
Expirado
45
12%
Ocupado
7
Desenvolvedor 7
Classificação
(169)
Projetos
204
30%
Arbitragem
25
40% / 44%
Expirado
12
6%
Livre
8
Desenvolvedor 8
Classificação
(596)
Projetos
928
46%
Arbitragem
31
39% / 29%
Expirado
93
10%
Livre
9
Desenvolvedor 9
Classificação
(23)
Projetos
23
57%
Arbitragem
2
50% / 0%
Expirado
0
Livre
10
Desenvolvedor 10
Classificação
(37)
Projetos
37
24%
Arbitragem
0
Expirado
0
Livre
11
Desenvolvedor 11
Classificação
(126)
Projetos
151
48%
Arbitragem
6
83% / 17%
Expirado
2
1%
Livre
12
Desenvolvedor 12
Classificação
(15)
Projetos
17
6%
Arbitragem
1
0% / 100%
Expirado
1
6%
Livre
13
Desenvolvedor 13
Classificação
(196)
Projetos
318
35%
Arbitragem
64
13% / 56%
Expirado
82
26%
Livre
14
Desenvolvedor 14
Classificação
(34)
Projetos
60
23%
Arbitragem
11
73% / 9%
Expirado
3
5%
Livre
15
Desenvolvedor 15
Classificação
(3)
Projetos
4
0%
Arbitragem
1
100% / 0%
Expirado
0
Livre
16
Desenvolvedor 16
Classificação
(42)
Projetos
49
47%
Arbitragem
1
100% / 0%
Expirado
1
2%
Livre
Pedidos semelhantes
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

Informações sobre o projeto

Orçamento
30+ USD
IVA (23%): 6.9 USD
Total: 36.9 USD
Desenvolvedor
27 USD