Stochastic + Tendency Channel Strategy correction

Job finished

Execution time 7 days
Feedback from customer
This is the first job I have ever requested and the code provided does what I put in the requirements, I appreciate the effort. Good job.
Feedback from employee
Buen trabajo, gracias por todo.

Specification

The principle for this work is to create a code for MQL5 that uses the stochastic and a tendency channel.


The strategy that is required to be corrected is based on the next:


Buy condition:

1.-  There need to be an uptrend. Mainly in my strategy I use the CHOCH and BOSS (  I didn't programed this on the provided code. ) to determine in which direction is the price going and I mark a tendency channel using the 2 maximum values and 2 minimum values. If it matches with more maximum and minimum levels that’s better. See the example in the images added.

2.- The Stochastic shows a cross between %K and %D, where %K crosses from bellow to above %D, making a condition similar to this:

(KValue0 > 20 && DValue0 > 20 && KValue0 > DValue0 && KValue1 <= DValue1 && KValue2 < DValue2) And (KValue0 > 20 && DValue0 > 20 && KValue0 > DValue0 && KValue1 >= DValue1 && KValue2 < DValue2)  See the example in the following slides.

3.- The price should be between the lower and middle lines of the tendency channel.

Sell condition:

1.-  There need to be an downtrend.

2.- The Stochastic shows a cross between %K and %D, where %K crosses from above to bellow %D, making a condition similar to this:

(KValue0 < 80 && DValue0 < 80 && KValue0 < DValue0 && KValue1 >= DValue1 && KValue2 > DValue2) And (KValue0 < 80 && DValue0 < 80 && KValue0 < DValue0 && KValue1 <= DValue1 && KValue2 > DValue2)  See the example in the following slides.

3.- The price should be between the upper and middle lines of the tendency channel.


The position should be opened with the following:


Sell position:

-The STP (Stop Loss) should be 3 points bellow the lower minimum of the previous 4 candles.

-The TP (Take Profit) should be 2 times the distance of the STP – Actual Price. Example: STP=15+3 , TP= (15+3)*2=36

Sell position:

-The STP (Stop Loss) should be 3 points above the higher maximum of the previous 4 candles.

-The TP (Take Profit) should be 2 times the distance of the STP – Actual Price. Example: STP=15+3 , TP= (15+3)*2=36


I require that if the account loss 1.5% of its total, stop the tradings and notify me via email. Example: the account started the day with 10000 dlls, and 13 hours after it losses 150 dlls it stops


Note: In the documents I added a code I was working in to try and do these things, please check it and tell me if it can be reworked or what can we do.
Also I added some lines to prevent the opening of operations 2 or 3 candles after one was opened and other lines to close the positions when the conditions where met.

Please use these conditions or some similar to do the same. 



The code I provided does the following:

1.- It calls the stochastic, EMA and MACD indicators (the last two are for trend identification, if you have a better way to detect trends be free to modify it or improve the conditions)

2.-Creates a tendency Channel using the all the candles in the screen but it may or may not be the better way to adapt to the strategy described above, becouse the channel does not identify the changes of tendency that fast.
3.- Open and close orders, but it a lot of times does not open a position even if the conditions are met, so the code needs help there, and sometimes it does not open the correct type of order, so I changed the order type from buy and stop to buy stop and sell stop.

4.-It prevent the opening of operations 2 or 3 candles after one was opened and other lines to close the positions when the conditions where met.

5.- I added an example for the price detection of highest high and lowest low at the end of the code, but i couldn't implement the operation to obtain the correct value for TP (2 times the STP distance)

The examples I used were the basic ones, I don’t know a lot of ways to do a trading code since I am a Mechatronic Engineer and I don’t know a lot of the things of the MQL5 language. If you know a better way to do the code feel free to tell me.


If you require more examples of the strategy that I explained on top and shown on the images or need more details please notify me.


Responded

1
Developer 1
Rating
(38)
Projects
40
25%
Arbitration
20
15% / 75%
Overdue
8
20%
Busy
2
Developer 2
Rating
(68)
Projects
77
8%
Arbitration
33
9% / 55%
Overdue
6
8%
Working
3
Developer 3
Rating
(63)
Projects
99
29%
Arbitration
1
100% / 0%
Overdue
2
2%
Free
4
Developer 4
Rating
(130)
Projects
184
32%
Arbitration
17
29% / 59%
Overdue
27
15%
Working
5
Developer 5
Rating
(196)
Projects
318
35%
Arbitration
64
13% / 56%
Overdue
82
26%
Free
6
Developer 6
Rating
(14)
Projects
22
23%
Arbitration
7
43% / 29%
Overdue
3
14%
Loaded
7
Developer 7
Rating
(4)
Projects
2
0%
Arbitration
2
50% / 0%
Overdue
0
Free
8
Developer 8
Rating
(4)
Projects
6
0%
Arbitration
5
0% / 80%
Overdue
2
33%
Free
9
Developer 9
Rating
(253)
Projects
407
38%
Arbitration
85
42% / 19%
Overdue
70
17%
Loaded
10
Developer 10
Rating
(56)
Projects
175
71%
Arbitration
4
100% / 0%
Overdue
1
1%
Free
11
Developer 11
Rating
(66)
Projects
143
34%
Arbitration
10
10% / 60%
Overdue
26
18%
Free
12
Developer 12
Rating
(121)
Projects
155
43%
Arbitration
20
60% / 20%
Overdue
8
5%
Working
Similar orders
looking for help to get my ibkr automated, i have strategies already built in composer and have JSON for them, i really just need to he setup and explanation on how to maintain it and add new strategies
// Define the properties input int ShortPeriod = 12; input int LongPeriod = 26; input double LotSize = 0.1; // OnTick function is called every time there is a price update void OnTick() { double shortMA = iMA(NULL, 0, ShortPeriod, 0, MODE_SMA, PRICE_CLOSE, 0); double longMA = iMA(NULL, 0, LongPeriod, 0, MODE_SMA, PRICE_CLOSE, 0); double prevShortMA = iMA(NULL, 0, ShortPeriod, 0, MODE_SMA, PRICE_CLOSE, 1);
Hello Greetings. I have a custom tradingview strategy I would like to convert to Metatrader 5 ( mt5 ) . I have the source code a and with me. Kindly bid if it is what you can do for me and let discuss about the project. Thanks
I need a AI signal generating bot for forex trading. The bot should operate such that when i put it in a chart it will analyse the market, after several minutes it will display whether the trade is buying or selling. It should display the one minute, five minute,15minute, 30 minute, one hour, 4 hours and daily time frame whether they are buying or selling. If it is buying the arrow should be green and if it is
Using Bollinger Band only. When price closes above upper BB, open Buy. If the length of the candle body that closed above the upper BB is more than Y pips, then do not Buy and remove the EA. Otherwise, continue to open Buy if crosses and close above upper BB and the number of positions is not more than Max No of Positions. The user will choose either Buy or Sell only. When price closes below the lower BB, close all
Hello freelancers here, I need an expert to help me with coding my script which is already working in pinescript, Moreover, i want a system whereby i can sell my trading bot and can give access with a license, I need an expert that can help me with this
hello great developer Can you make a high/low ticker tape on a table for 100 stock symbols? As a symbol makes a high or low throughout the day, it will appear on the table. i will be expecting great developer to bid for this project
Hello freelancers here, I need an expert to help me with coding my script which is already working in pinescript, Moreover, i want a system whereby i can sell my trading bot and can give access with a license, I need an expert that can help me with this, and my budget is $20, Thank you
Hello freelancers here, I need an expert freelancer to help me convert an expert advisor from MT4 to MT5. I have the MT4 source code, As for now i only got $15 for this project i don't have much on me at the moment, So i need someone who can work long terms cause i still have other projects i need him to work on for me
An EA based on Fibonacci 100 - 300 USD
I am in need of 2 EA based on Fibonacci re-tracement after a high or low is made,each EA will have a hedge trade on it.the hedge trade will be at the 38 percent of the Fibonacci..this will be present on the 2 EA, the 2 EA will have different levels of re-tracement, while the hedge trade will be a continuation (buy/sell stop), while the re-tracement trades will be (buy/sell limit)This EA must work on timeframe ranging

Project information

Budget
30 - 70 USD
For the developer
27 - 63 USD
Deadline
to 15 day(s)