Hedging Trading Robot coding required

Lavoro terminato

Tempo di esecuzione 2 giorni

Specifiche

I am looking to have the below code cleaned up and formed into an ex4. I am getting a headache trying to do this myself.


This is a continuing project and I would like to continually develop and improve this EA.


The logic for this EA is as follows

*initiate trade everyday at 23:00 GMT or 1:00 PST.

*initiate a hedge by putting on both a long and a short order.

*set a 20pip Take Profit and a 100pip Stop Loss on both orders.

*Initial lot size = (account balance/100,000). As an example, if the account balance is $10,000 then the lot size would equal .1.

*If the previous trade resulted in a profit then keep the lot size at(account balance / 100,000) However, If the previous trade resulted in a loss then adjust the lot size to (account balance/20,000) so now a $10,000 account would have a lot size of .5




input int start_hour = 23;
input int start_minute = 0;
input int end_hour = 0;
input int end_minute = 0;
input int take_profit = 20;
input int stop_loss = 100;
input int winning_denom = 100000;
input int losing_denom = 20000;
input string order_comment = *EA20 Fresh Start*;
input int signal_bar = 0;

int magic_number;
int fract_factor = 1;
int OnInit (){
magic_number = (int) TimeCurrent ();
if (Digits == 5 || Digits == 3) fract_factor = 10;
Print (*EA20 is initialized. Magic number is *+ (string)magic_number);
return (INIT_SUCCEEDED);
}

void OnTick(){
static datetime last_open_signal_time = 0;
if (OpenSignal (signal_bar) ++ Time [0] ! = last_open_signal_time) {
Order (OP_BUY);
Order (OP_SELL);
last_open_signal_time = Time [0];

}

static datetime last_close_signal_time = 0;
if (CloseSignal(signal_bar)++ Time [0] ! = last_open_signal_time){
CloseAllTrades();
last_close_signal_time = Time [0]

}
}

void OnDeinit (const int reason) {
}

double GetLastTradeProfit(){
double profit = EMPTY_VALUE;
datetime close_time = 0;
for (int i = OrdersHistoryTotal() - 1; i > = 0; i --)
if (OrderSelect(i, SELECT_BY_POS_MODE_HISTORY))
if (OrderMagicNumber() == magic_number ++ OrderCloseTime()> close_time){
}
return profit;
}

void CloseAllTrades (int order_type =-1){
for (int i = OrdersTotal() -1; i >= 0; i --)
if (OrderSelect(i, SELECT_BY_POS))
if ((OrderType() <= 1 ++ order_type ==-1) || (OrderType () == order_type))
if (OrderMagicNumber () == magic_number)
if
(!OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(), 10* fract_factor, clr NONE))
Print (GetLastError());
}

int Order (int order_type) {
double price = (order_type == OP_BUY) ? Ask: Bid;
double tp = (take_profit == 0)? 0: (order_type == OP_BUY)? price + take_profit* Pip(): price - take_profit * Pip();
double sl= (stop_loss == 0)?0: (order_type == OP_BUY)? price - stop_loss * Pip(): price + stop_loss * Pip();
double denom = (GetLastTradeProfit() == EMPTY_VALUE)? winning_denom: (GetLastTradeProfit() > 0)? winning_denom: losing_denom;
double lot = AccountBalance()/denom;
double min_lot = Market_Info(Symbol(),MODE_MINLOT);
lot= NormalizeDouble (lot,1);
lot= MathMax (min_lot, lot);
return
OrderSend(Symbol(), order_type,lot,price,10,sl,tp, order_comment, magic_number,0,clr NONE);
}

double Pip(){
return Point * fract_factor;
}

bool OpenSignal (int shift) {
if (TimeHour(Time[shift]) == start_hour ++ TimeMinute(Time[shift]) == start_minute)
return true;
return false;
}

bool CloseSignal (int shift){
if (TimeHour(Time[shift]) == end_hour ++ TimeMinute(Time[shift]) == end_minute ++ (end_hour ! = 0 || end_minute ! = 0))
return true;
return false;
}

Con risposta

1
Sviluppatore 1
Valutazioni
(253)
Progetti
358
49%
Arbitraggio
24
25% / 50%
In ritardo
80
22%
Gratuito
2
Sviluppatore 2
Valutazioni
(117)
Progetti
138
41%
Arbitraggio
30
7% / 77%
In ritardo
17
12%
Gratuito
3
Sviluppatore 3
Valutazioni
(35)
Progetti
40
23%
Arbitraggio
10
10% / 50%
In ritardo
16
40%
Gratuito
4
Sviluppatore 4
Valutazioni
(89)
Progetti
137
24%
Arbitraggio
35
9% / 40%
In ritardo
52
38%
Gratuito
5
Sviluppatore 5
Valutazioni
(219)
Progetti
370
42%
Arbitraggio
145
17% / 41%
In ritardo
124
34%
Gratuito
6
Sviluppatore 6
Valutazioni
(53)
Progetti
74
26%
Arbitraggio
30
10% / 63%
In ritardo
22
30%
Gratuito
7
Sviluppatore 7
Valutazioni
(298)
Progetti
427
26%
Arbitraggio
18
61% / 33%
In ritardo
26
6%
Gratuito
Ordini simili
I don't see signals on the chart .... On mt4 it's perfect...but when I converted it to Tradingview by a guy on here it doesn't show any signals, I need an expert that can help me to work on it, that can also work on more projects, Thanks, I have $20 for this project now, If you think is too small and you want to charge $30, i can pay you the rest later on
1. **Trade Execution:** - The bot should be capable of entering and exiting trades based on predefined signals from my trading strategy. 2. **Take Profit:** - Implement mechanisms to take profit at specific levels as defined by my strategy. ### Additional Features: - The bot should be able to handle multiple trades simultaneously. - It must have a user-friendly interface for monitoring and adjustments. -
hello great developer I have an mt4 indicator that stopped working with the new mt4 build. Can you fix it to work with the new mt4 build? I do not have the source code. i will looing for great developer that wil bid for it quickly
can anyone here help me with develop a Pine script on TradingView's Pine Editor for a trading strategy based on certain variations of the Morning Star candlestick pattern which I have been noticing from last 2 years
hi.. i have a pin script (TV) but some lines in the code needs to be fixed,,, i will attach the file, Also I will be paying $20 for the project cause i just need you to adjust some Minor things in it, i will explain more further in the message side
I want to clarify some points, such as: When entering into a buy deal, he opens three deals, each deal has a different take profit and one stop loss. When you look at the code, you will know that there are three take-profit. It opens one deal, taking one profit and adding risk management as well An information screen on the chart shows all the information, I only have $10 for this now, and also I still have more
PLEASE NOT THAT MY BUDGET IS 60usd FOR BOTH MT4 AND MT4 PLATFORMS The EA should have 1. An option that I can change it parameters, that's the period, method and application 2. The EA should sell when on every bullish candle that closes under the MA 3. The EA should buy on every bearish candle that forms Above the EA. It's should close trades on reverse cross. I mean when it's in a buy trade and crosses the MA for a
GOOD DAY DEVELOPERS I NEED A GOOD DEVELOPER WHO HAS AN INDICATOR FOR BOOM AND CRASH UP / DOWN TRENDS FOR ATLEAST 10 CANDLESTICK WITHOUT BEING SPIKED ... TO DEVELOP AN EA BASED ON THAT INDICATOR YOU HAVE, IF YOU HAVE IT PLEASE I AM IN NEED OF IT
Hello I want to buy a strategy and put it in an indicator I have This strategy must be strong, with a profit rate of +90% without repeating or deleting the signal The signal should be 1 minute to 5 minutes maximum I do not have a specific strategy or ideas. You show me your strategies and I am ready to test it send ex4 to test it and videos or images too
Hey greetings My pleasure to met you all .I would like to convert a public tradingview pinescript indicator to MT5 Expert Advisor based on my. Requirements/specification.Kindly bid and let discuss about the project

Informazioni sul progetto

Budget
50 - 1000 USD
Per lo sviluppatore
45 - 900 USD