Greetings
Since this is my first proper post on the forum, I will quickly introduce myself.
My name is Rueben, and I am an 18-year-old student – born in South African and now living in Australia. You may recognise my name from the two new systems I have worked on with @SteveHopwood. During the past few months, I worked through the entire forum, and I just wanted to congratulate you all on the amazing work you guys have done to date and hope I can add to it.
Edit
This is more a project than a singular system and my anticipation is that as we move through this there will be several systems with the same principles developed. The end goal though is to have one united system that follows the principles outlined below and that trades consistently and profitably.
Trading Principles
During my short career in the markets, and guidance from my dad (@jopip), I have learned the following principles, and these will be the cornerstones of my trading systems.
Principle 1 – Remove emotions and execution errors from trading by utilising automated trading system.
Principle 2 –Price must move in a direction and can’t stay stagnant.
Principle 3 – Flow like Water – Do not focus too much on trying to predict where the market will go. Rather focus on how trades are executed to result in an overall profit.
Techniques to Implement:
- Grid Trading
- Stacking
- Leveraging from the size of trades
(These techniques will be explained in more detail later)
Principle 4 – Limit losses with unlimited gain (in line with Equity millipede approach/ philosophy).
Take positions on a lower timeframe and take profits on a higher timeframe.
Quest of this Thread = Water
To develop a profitable trading system that regardless of the direction of price movement eventuate in a profitable result.
Hence why I call it "Water", because the idea behind it is to flow like water with the market in whatever direction the market moves and capitalise on the bigger movements in a way that results in a profit.
We do not want to get bogged down to predict the direction of the market, but simply follows the market and generates profit through how the trades are executed and trade sizes managed.
This might seem and audacious quest for a young and fairly inexperienced man to pursue. But I am optimistic that if we build on the knowledge and skills present in @Stevehopwood community we can achieve it.
In line with Principle 2 above, what I’ve learnt from my dad is that there is only one guarantee in forex trading: THE PRICE WILL MOVE. So, this system does not care which way it moves, simply that it does and the further in one direction it moves, the more profit it will generate.
Although the next statement refers to gambling, I am all against gambling and the system/s we will develop will not be based on luck.
However, what the Forex market does provide us is a platform to create our own casino where we determine the odds without any table limits. If we can find a way to tilt the odds our way, statistically we are going to make money over the long run. That is what this project is about.
You guys will have to forgive me because I am new to coding, please be patient on my coding ability. Steve has already coded a base version of a system capturing some of the elements. I will attach it below along with my further additions to it.
Enough babble from me, the details of this system is provided in the PDF attached.
If you guys have any further questions or need me to clarify something, feel free to PM me.
System Development
To manage an organised process to develop the system, we will break the development into 4 stages.
- Stage 1 – Trade Structure/ Framework
- Stage 2 – Trade Execution - How to maximise the benefit from price movement
- Stage 3 – Equity growth
- Stage 4 - Consolidation
Water EA
- SteveHopwood
- Owner
- Posts: 9754
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Water EA
I will post here to attract some interest.
Rueben is a rising star here.This young man is searingly bright.
I will open a new thread for Moving Day Adapted once I am sure the code is bug-free as it works differently to Water and there is no point in a thread confusing two different EA's.
For your information MDA is performing excellently on my demos.
Join in here developing Water, folks. You will not be sorry.
Rueben is a rising star here.This young man is searingly bright.
I will open a new thread for Moving Day Adapted once I am sure the code is bug-free as it works differently to Water and there is no point in a thread confusing two different EA's.
For your information MDA is performing excellently on my demos.
Join in here developing Water, folks. You will not be sorry.
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- Wavegarrick
- Trader
- Posts: 1172
- Joined: Sun Dec 30, 2012 11:21 am
- Location: South Africa
Water EA
Hi Rueben,
Glad to have you here and nice to see refreshing young blood. It reminds me of my sister emigrating to Australia, and she has a son of your age. Proud of you
Cheers.
Glad to have you here and nice to see refreshing young blood. It reminds me of my sister emigrating to Australia, and she has a son of your age. Proud of you
Cheers.
- Weyk
- Trader
- Posts: 42
- Joined: Mon Apr 10, 2017 3:53 pm
Water EA
Damn! Rueben, do you know CP posts??
I like your idea very much.
It is like trading the ladder. INDEED. When you trade the ladder there is no history involved.
I like your idea very much.
It is like trading the ladder. INDEED. When you trade the ladder there is no history involved.
If you put your mind onto something sooner or later it will come up with the solution.
- Rueben
- Posts: 5
- Joined: Tue Apr 21, 2020 1:28 am
- Location: Australia
Water EA
Hey Guys,
Had a look at my original post and there was a bit of lack of clarity and there wasn't a clear directive and end goal for the forum thread so I have edited it to hopefully make it a bit more clear and to help those that want to get involved to get an idea of what the stages of development for this system is going to be.
I have broken the PDF into stages aswell and have added a second idea into that stage one.
Sorry this is a bit messy this is my first thread and didn't plan it as well as I should've.
Had a look at my original post and there was a bit of lack of clarity and there wasn't a clear directive and end goal for the forum thread so I have edited it to hopefully make it a bit more clear and to help those that want to get involved to get an idea of what the stages of development for this system is going to be.
I have broken the PDF into stages aswell and have added a second idea into that stage one.
Sorry this is a bit messy this is my first thread and didn't plan it as well as I should've.
-
- Trader
- Posts: 176
- Joined: Thu May 12, 2016 7:46 am
Water EA
Hi Rueben and welcome to the forum!
Love the idea and well done on the EA too
I decided to throw it up on a demo to see how it goes but it's instantly throwing up an error order not found, error #0 and doesn't seem to be behaving how it's described.
Will continue to follow with interest and will keep testing
Love the idea and well done on the EA too
I decided to throw it up on a demo to see how it goes but it's instantly throwing up an error order not found, error #0 and doesn't seem to be behaving how it's described.
Will continue to follow with interest and will keep testing
- Rueben
- Posts: 5
- Joined: Tue Apr 21, 2020 1:28 am
- Location: Australia
Water EA
Hey Wally,wallywonka » Wed Jun 10, 2020 3:29 pm wrote:Hi Rueben and welcome to the forum!
Love the idea and well done on the EA too
I decided to throw it up on a demo to see how it goes but it's instantly throwing up an error order not found, error #0 and doesn't seem to be behaving how it's described.
Will continue to follow with interest and will keep testing
Yeah, the code is not finished yet. I am currently struggling with finding a way for the system to place another set of trades once one of the trades have been executed but keep running into an infinite loop. Like I said I'm just beginning to learn the code so it's nothing special but that's why I am here to learn.
If anyone has some tips for me would be greatly appreciated.
- SteveHopwood
- Owner
- Posts: 9754
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Water EA
It looks to me as though you are trying to code a multi-pair EA. I can see from the comments that you are going about it in a long winded way that will land you with masses of unreadable spaghetti style code.
I am not a proper coder like Rene, but I have learned a lot.
You can simplify things a lot by using arrays. The compiler recognises an array when a variable is followed by []. For example:
int someNumber[4];
declares the array someNumber[4] as an array of 4 elements, each of which can hold a value, for example:
someNumber[0] = 5;
someNumber[1] = 10;
someNumber[2] = 15;
someNumber[3] = 25;
Notice how arrays are indexed from zero so someNumber[4] is not accessible.
Arrays can be dynamic. This declaration declares a dynamic array:
string tradePair[];
declares tradePair[] as an array that can be resized in the body of your code.
Let's start with how I set up the trading pairs in all my multi pair bots. You will see my extern input:
Of itself, this string is no use to the programmer, so I need to store the individual pairs in an array. Further down you will see these two declarations and their associated comments:
int noOfPairs;// Holds the number of pairs passed by the user via the inputs screen
string tradePair[]; //Array to hold the pairs traded by the user
I have a function to populate the tradePair[] array with the lost of pairs in PairsToTrade:
This tells the compiler that PairsToTrade is a comma delineated string that is to be transferred to the tradePair[] array. noOfPairs holds the number of elements in the tradePair[] array.
The call to extractPairs() goes in OnInit() i.e.
You iterate through the array and call functions to do whatever is required. So:
I declare 'symbol' simply because it is quicker to type than tradePair[pairIndex] - and I type it a lot.
I like to have Bid, Ask etc as variables is can use throughout the code without constantly addressing MarketInfo(). You will see this in the declarations at the top of my code:
And then further down:
The getBasics() function populates these variables:
Take out 'spread' for now.
This line:
factor = getPipFactor(symbol);
calls a function that turns pips into points:
To show how powerful all this is, declare a take profit and stop loss:
double takeProfit = 50;
double stopLoss = 25;
then add a function that displays some values e.g.
Then add the call to the iteration loop:
Leave the iteration loop inside OnTick() for now. It needs to go inside an OnTimer() in a multi pair EA but let's talk about that when you have played with arrays and discovered how much typing they save you.
Sing out if there is anything you do not understand. I am sure that others are interested in this.
I am not a proper coder like Rene, but I have learned a lot.
You can simplify things a lot by using arrays. The compiler recognises an array when a variable is followed by []. For example:
int someNumber[4];
declares the array someNumber[4] as an array of 4 elements, each of which can hold a value, for example:
someNumber[0] = 5;
someNumber[1] = 10;
someNumber[2] = 15;
someNumber[3] = 25;
Notice how arrays are indexed from zero so someNumber[4] is not accessible.
Arrays can be dynamic. This declaration declares a dynamic array:
string tradePair[];
declares tradePair[] as an array that can be resized in the body of your code.
Let's start with how I set up the trading pairs in all my multi pair bots. You will see my extern input:
Code: Select all
extern string PairsToTrade = "AUDCAD,AUDCHF,AUDNZD,AUDJPY,AUDUSD,CADCHF,CADJPY,CHFJPY,EURAUD,EURCAD,EURCHF,EURGBP,EURNZD,EURJPY,EURUSD,GBPCHF,GBPJPY,GBPUSD,NZDUSD,NZDJPY,USDCAD,USDCHF,USDJPY";
int noOfPairs;// Holds the number of pairs passed by the user via the inputs screen
string tradePair[]; //Array to hold the pairs traded by the user
I have a function to populate the tradePair[] array with the lost of pairs in PairsToTrade:
Code: Select all
void extractPairs()
{
StringSplit(PairsToTrade,',',tradePair);
noOfPairs = ArraySize(tradePair);
ArrayResize(tradePair, noOfPairs);
}//End void extractPairs()
The call to extractPairs() goes in OnInit() i.e.
Code: Select all
int OnInit()
{
//Extract the pairs traded by the user
extractPairs();
}
Code: Select all
for (int pairIndex = 0; pairIndex < ArraySize(tradePair); pairIndex++)
{
string symbol = tradePair[pairIndex];
getBasics(symbol);
}//for (int pairIndex = 0; pairIndex < ArraySize(tradePair); pairIndex++)
I like to have Bid, Ask etc as variables is can use throughout the code without constantly addressing MarketInfo(). You will see this in the declarations at the top of my code:
Code: Select all
double ask=0, bid=0, spread=0;//Replaces Ask. Bid, Digits. factor replaces Point
int digits;//Replaces Digits.
double longSwap=0, shortSwap=0;
Code: Select all
//Calculating the factor needed to turn pip values into their correct points value to accommodate different Digit size.
//Thanks to Tommaso for coding the function.
double factor;//For pips/points stuff.
Code: Select all
void getBasics(string symbol)
{
//Sets up bid, ask, digits, factor for the passed pair
bid = MarketInfo(symbol, MODE_BID);
ask = MarketInfo(symbol, MODE_ASK);
digits = (int)MarketInfo(symbol, MODE_DIGITS);
factor = getPipFactor(symbol);
//spread = (ask - bid) * factor;
longSwap = MarketInfo(symbol, MODE_SWAPLONG);
shortSwap = MarketInfo(symbol, MODE_SWAPSHORT);
}//End void getBasics(string symbol)
This line:
factor = getPipFactor(symbol);
calls a function that turns pips into points:
Code: Select all
//Thomas and Rene provided this pip factor function. Thanks guys.
//There is also a contribution by lifesys, who gave us the first ever
//incarnation of this.
double getPipFactor(string symbolName)
{
static bool brokerDigitsKnown=false;
static int brokerDigits=0;
// We want the additional pip digits of the broker (only once)
if(!brokerDigitsKnown)
{
// Try to get the broker digits for plain EURUSD
brokerDigits=(int)SymbolInfoInteger("EURUSD",SYMBOL_DIGITS)-4;
// If plain EURUSD was found, we take that
if(brokerDigits>=0)
brokerDigitsKnown=true;
// If plain EURUSD not found, we take the most precise of all symbols containing EURUSD
else
{
brokerDigits=0;
// Cycle through all symbols
for(int i=0; i<SymbolsTotal(false); i++)
{
string symName=SymbolName(i,false);
if(StringFind(symName,"EURUSD")>=0)
brokerDigits=MathMax(brokerDigits,(int)SymbolInfoInteger(symName,SYMBOL_DIGITS)-4);
}
brokerDigitsKnown=true;
}
}
// Now we can calculate the pip factor for the symbol
double symbolDigits = (int) SymbolInfoInteger(symbolName,SYMBOL_DIGITS);
double symbolFactor=MathPow(10,symbolDigits-brokerDigits);
return(symbolFactor);
}//End int getPipFactor(string symbolName)
double takeProfit = 50;
double stopLoss = 25;
then add a function that displays some values e.g.
Code: Select all
void displayDetailsForBuyTrades(string symbol, int pairIndex)
{
takeProfit = NormalizeDouble(ask + (takeProfit / factor), digits);
stopLoss = NormalizeDouble(ask - (stopLoss / factor), digits);
Alert(symbol, " ", pairIndex, ": ask = ", DoubleToStr(ask, digits), ": TP = ",
DoubleToStr(takeProfit, digits), ": SL = ", DoubleToStr(stopLoss, digits));
}//End void displayDetailsForBuyTrades(string symbol, int pairIndex)
Code: Select all
for (int pairIndex = 0; pairIndex < ArraySize(tradePair); pairIndex++)
{
string symbol = tradePair[pairIndex];
getBasics(symbol);
displayDetailsForBuyTrades(symbol, pairIndex);
}//for (int pairIndex = 0; pairIndex < ArraySize(tradePair); pairIndex++)
Sing out if there is anything you do not understand. I am sure that others are interested in this.
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- Rueben
- Posts: 5
- Joined: Tue Apr 21, 2020 1:28 am
- Location: Australia
Water EA
Thanks Steve for this!!SteveHopwood » Thu Jun 11, 2020 12:40 am wrote:It looks to me as though you are trying to code a multi-pair EA. I can see from the comments that you are going about it in a long winded way that will land you with masses of unreadable spaghetti style code.
I am not a proper coder like Rene, but I have learned a lot.
You can simplify things a lot by using arrays. The compiler recognises an array when a variable is followed by []. For example:
int someNumber[4];
declares the array someNumber[4] as an array of 4 elements, each of which can hold a value, for example:
someNumber[0] = 5;
someNumber[1] = 10;
someNumber[2] = 15;
someNumber[3] = 25;
Notice how arrays are indexed from zero so someNumber[4] is not accessible.
Arrays can be dynamic. This declaration declares a dynamic array:
string tradePair[];
declares tradePair[] as an array that can be resized in the body of your code.
Funny how when you think you are starting to get the gist of the code and then you realise you've got such a long way to go
Good thing really though, means there is a lot more to learn which never does any harm. Will dig into this and play with it a bit to get familiar with it.
Thanks again for your incredible support and generosity