![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
What criteria is used to determine trend direction?
ES
If Long_Short_Balance is true, you CAN NOT choose your own progression.
Long_Short_Balance uses the Start_Lot_Size & the Lot_Size_Increment. When a trend direction change is detected and another trade signal occurs, the EA will "equalize" the long and short lot sizes (now you are fully hedged), plus it will add Balance_Weight to the side of you're new trend.Depends if you are using MA entry, or kayvan method, pyramid true, or pyramid false.
Basically a Long_Short_Balance would happen if your last order was a short, and you just got a signal to open a long. Or the other way around of course. This would happen only if Long_Short_Balance was set to true, and ALL other lot size decisions were set to false.
Right here is what I had to code JUST to determine the next lot size in a trade progression, depending on how the user set it up.
{
Lot_Size=LastLots+Lot_Size_Increment;
}
if (Double_Lotsize==true)
{
Lot_Size=LastLots*2;
}
if (Long_Short_Balance==true)
{
if (SellLots>BuyLots)
{
Lot_Size=((SellLots-BuyLots)+Balance_Weight);
}
else Lot_Size=LastLots+Lot_Size_Increment;
}
if (Choose_Own_Progression==true)
{
if(OTBM(Magic_Number)==1){Lot_Size=Trade_2;}if(OTBM(Magic_Number)==2){Lot_Size=Trade_3;}
if(OTBM(Magic_Number)==3){Lot_Size=Trade_4;}if(OTBM(Magic_Number)==4){Lot_Size=Trade_5;}
if(OTBM(Magic_Number)==5){Lot_Size=Trade_6;}if(OTBM(Magic_Number)==6){Lot_Size=Trade_7;}
if(OTBM(Magic_Number)==7){Lot_Size=Trade_8;}if(OTBM(Magic_Number)==8){Lot_Size=Trade_9;}
if(OTBM(Magic_Number)==9){Lot_Size=Trade_10;}if(OTBM(Magic_Number)==10){Lot_Size=Trade_11;}
if(OTBM(Magic_Number)==11){Lot_Size=Trade_12;}if(OTBM(Magic_Number)==12){Lot_Size=Trade_13;}
if(OTBM(Magic_Number)==13){Lot_Size=Trade_14;}if(OTBM(Magic_Number)==14){Lot_Size=Trade_15;}
if(OTBM(Magic_Number)==15){Lot_Size=Trade_16;}if(OTBM(Magic_Number)==16){Lot_Size=Trade_17;}
if(OTBM(Magic_Number)==17){Lot_Size=Trade_18;}if(OTBM(Magic_Number)==18){Lot_Size=Trade_19;}
if(OTBM(Magic_Number)==19){Lot_Size=Trade_20;}
}
RefreshRates();
Ticket=OrderSend(Symbol(),OP_BUY,Lot_Size,Ask,Slippage,NULL,NULL,"TFX_LONG_ADDITIONAL",Magic_Number,0,Green);[/PHP]
As you see it got very confusing, and it does have some limitations. Code reads left to right, top to bottom, just as you or I would.(only it does this in a nano second)
Now you can see the last decision method the code reads is this one:
[PHP]if (Choose_Own_Progression==true)
{If Choose_Own_Progression is set to true, this is the last thing the code reads to decide which method for lot size it will use, all others that were true will not execute. Only the last one that the code read to be true.
Sorry if I just confused you more.
wolfe,
You do not fool me...
WolfeIsNotaWannabeeHeHasGraduatedSavant
Woops! Even us wanna-be coders get confused!
Here is a quick back best the data is standard and there are a lot of errors with in the data.
Have a look at the end.
I have tried multiple setups but the same result occurs.
Cheers
BenoBeno,
Thanks for running some back tests. I would be interested to see what happens if you were to run the exact same back test, only make your initial deposit more than $100.00. Make it like $5000.00, or even $10000.00.
Back tests are pretty un-reliable. But some combinations show promise. Check this one out. There is always some kind of a drop off in profit at the end, because the EA is usually in the middle of a cycle trying to make your profit, and then the tester closes all when you hit your ending date.
Thanks wolfe for such a wonderful work put together in this version, overall the quality, ideas and inputs are never seen before. So, we all will do a full forward test with this and report the bugs. However, I know it is impossible to expect without any faults on it, the shell of the EA is the very important part. Hope this will be a nice EA after all corrections. SuperPower vehicle on the forex road with many controls and gadgets to play.
You're welcome.
Glad to have you involved as a tester. Please report any problems you find.
The first thing you can say to me after giving you this for free.? Did you run a back test? The market isn't even open yet.
wolfe i thanked you before doing it . and i always say thank you .
but do we need to open market for have a back test?
kayvan..
you might have phrased your query like this:
I am trying to run some backtests in the new version...but I am stumbling...perhaps I need to understand a little more about how to combine the inputs...but here is what I did...
my setfile:
........
........
etc........
Write like that kayvan...wolfe does not need praise, but more analytical and precise questions..put in a more diplomatic way.
Not like you did and how your post sounded to us.... I can't get this to work the whole EA is not working...Please FIX IT
Just a suggestion...and excuse me for butting in.
ES
wolfe i thanked you before doing it . and i always say thank you . but do we need to open market for have a back test?
wolfe,
Please excuse my numerous questions...I just want to make sure. Will this combination below give me a trail starting when the float reaches $6 bucks and exit me at $5 bucks, assuming it didn't lock in any more profit?
Use_Trailing_Stop=true
Trail_Start=6.0
TSLoss_Percent=83.4
Close_By_Profit=99999.0
Close_By_StopLoss=99999.0
ES83.4% of 6 = 6 x 0.834 = 5.004
83.3% of 6 = 6 x 0.833 = 4.998
So, this is about right.
Close_By_Profit & TSLoss_Percent are ignored when Use_Trailing_Stop=true
wolfe i thanked you before doing it . and i always say thank you . but do we need to open market for have a back test?
Sorry kayvan, you are right.
Have you run the back tester before? If not, that's another thing for you to learn.
Back tests are not very reliable anyway.
wolfe,
Thank you for the chrystal clear answer...I veered to the upside as I want a minimum of 5 bucks....
Folks another point when you get into higher progressions...you will notice the incremental jumps in float become larger...so this is not an exact science...also it takes time to close three or four orders automatically, sometimes more that one tick.
SatsangSavant
P.S. I hope I am answering a lot of questions by example...remember there are not any dumb questions...also it helps wolfe to check and find bugs...
83.4% of 6 = 6 x 0.834 = 5.004
83.3% of 6 = 6 x 0.833 = 4.998
So, this is about right.
Close_By_Profit & TSLoss_Percent are ignored when Use_Trailing_Stop=truekayvan...one more thing..
Do you realize that you with others here are one of the founders of this EA?
That alone is quite a responsibility and please be careful when speaking to a global audience...you are representing one of the soon-to-be great EA/Utilities...to be used by many...this is an archived thread in history and people will be reading this for years to come...
ES
P.S. I am doing my best to keep the peace here and it is incredible that all of us have acted so human-like and at the same time have remained gentlemen...this is an incredible positive display of how threads can go....Thank you everybody...I have and am enjoying this method...and I hope you are too! understand that things can escalate out of control and we must keep the work going and continue to be analytical in nature and leave emotions behind.