Termos de Referência
Caro desenvolvedor, eu estou elaborando um gerenciamento de risco e estou travado em alguns pontos nesse gerenciamento, gostaria de um suporte de um colega programador para me ajudar a desenvolver com a formula que gostaria a logica é a seguinte double MM_Size() // martingale / anti-martingale
{
double SL;
// Assumindo que a lógica para determinar StopSell e StopBuy já foi definida em algum lugar
if (ORDER_TYPE_BUY) {
SL = ATR2[Shiftatrbuystop] * StopBuy; // Stop Loss = Average True Range * fixed value
} else {
SL = ATR4[ShfitStopatrSell] * StopSell; // Stop Loss = Average True Range * fixed value
}
double tickvalue = SymbolInfoDouble(Symbol(), SYMBOL_TRADE_TICK_VALUE);
double ticksize = SymbolInfoDouble(Symbol(), SYMBOL_TRADE_TICK_SIZE);
double lots = MM_Percent * 1.0 / 100 * AccountInfoDouble(ACCOUNT_BALANCE) / (SL / ticksize * tickvalue);
double MaxLot = SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_MAX);
double MinLot = SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_MIN);
ulong ticket = 0;
if ( ORDER_TYPE_BUY) {
ticket = LastBuyOrderTicket();
} else {
ticket = LastSellOrderTicket();
}
if (ticket > 0) {
double lastDealVolume = HistoryDealGetDouble(ticket, DEAL_VOLUME);
double lastDealProfit = HistoryDealGetDouble(ticket, DEAL_PROFIT);
if (lastDealProfit > 0 && !MM_Martingale_RestartProfit) {
lots = lastDealVolume * MM_Martingale_ProfitFactor;
} else if (lastDealProfit < 0 && !MM_Martingale_RestartLoss) {
lots = lastDealVolume * MM_Martingale_LossFactor;
} else if (lastDealProfit == 0) {
lots = lastDealVolume;
}
} else
if(ConsecutivePL(false, MM_Martingale_RestartLosses))
lots = MM_Percent * 1.0 / 100 * AccountInfoDouble(ACCOUNT_BALANCE) / (SL / ticksize * tickvalue);
if(ConsecutivePL(true, MM_Martingale_RestartProfits))
lots = MM_Percent * 1.0 / 100 * AccountInfoDouble(ACCOUNT_BALANCE) / (SL / ticksize * tickvalue);
if(lots > MaxLot) lots = MaxLot;
if(lots < MinLot) lots = MinLot;
return(lots);
} //Quero que ela aplique os stops de maneira correta pois me parece que nao esta sendo calculado corretamente por ter 2 tipos de stops, quero que o martingale seja aplicado somente no tipo de ordem ou seja Buy aplica martingale somente Buy, Sell somente Sell... Reiniciar o loop somente se o profit Atual bateu todas as sequencias de loss de determinado Tipo de ordem
Respondido
1
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
2
Classificação
Projetos
37
11%
Arbitragem
0
Expirado
0
Livre
3
Classificação
Projetos
17
59%
Arbitragem
2
0%
/
100%
Expirado
2
12%
Livre
4
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Pedidos semelhantes
VMP Painel
45+ USD
Construction of trading panel Trading panel with vertical and horizontal stop take profit lines and multiplication grid 1 horizontal and vertical purchase and sales lines and placement of orders in a grid with order number multiplier 2 that all lines must be visible with stop and take profits pre orders, all lines must be visible on the chart I'll post a picture to give you an idea of what it could be
Tenho um código de EA que preciso adicionar a estratégia de traling stop baseado em média móvel. Desejo que o trailing seja ativado após XX pontos a favor da operação aberta, podemos testar com 50 pontos de início, e o trailing stop ficar posicionado sempre na média móvel de 9 períodos , sendo arrastado a cada tick a favor da operação
Preciso de um Robo q faca o sinal de alerta do cruzamento de 2 linhas medias (21 periodos simples e exponencial) para 3 times frames especiicos. Algo simples e pratico, so isso
Informações sobre o projeto
Orçamento
33+ USD
Desenvolvedor
29.7
USD