• Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)

New EA TRIANGULAR PRICE CORRECTION

That doesn't seem right....what is your spread setting in mt4 backtest? Maybe it's set too high.

Set it to 2. And try again.

And please don't take that set file for granted....it's just an experimental stuff.

Although this ea has flaws and it's not a holly grail, your equity curve shouldn't look like this. Ea should make positive equity curve....so I think there must be a mistake in your backtester settings.

Please let me know, if you will find the problem.

Your Triangular_Price_Correction_Hedge
&
Your Set file

I attached a trade.
Please look.

Trede is almost lose the fee.

Please improve.
 

Attachments

Your Triangular_Price_Correction_Hedge
&
Your Set file

I attached a trade.
Please look.

Trede is almost lose the fee.

Please improve.

Hi,

Ea is rewritten and you have the clean code, plus additional filters. I think i don't need to repair anything at this point...

You should do more testing and finding the right settings for you. If that picture is your today's trades...then clearly your commisions on ICmarkets are eating the profits for you. They are too high.

Here is what you can do;

1. Forget my set file
2. Set trailing stop to false
3. Create your own set file
4. Backtest it on demo before going live

I hope this helps.
 
Hi,

Ea is rewritten and you have the clean code, plus additional filters. I think i don't need to repair anything at this point...

You should do more testing and finding the right settings for you. If that picture is your today's trades...then clearly your commisions on ICmarkets are eating the profits for you. They are too high.

Here is what you can do;

1. Forget my set file
2. Set trailing stop to false
3. Create your own set file
4. Backtest it on demo before going live

I hope this helps.

ok, Thank you !
 
Here it is,

Completely rewritten code and also bug free now.

Additional parameters were added:

1. Trend following option:
You have now option for trades to follow higher trend. You can chose up to 3 higher time frames in parameters.
For example: 60min, 240min and 1440min, This means, trades will be only opened, when price will be above all 3 higher candles open lines.
When price will be in between, it is considered as ranging market and Ea will not take additional trades. You can also set all 3 open lines to the same time frame.
For example: 60min, 60min, 60min....this means Ea will open buys only above 60min and sell trades only below 60min. You can set open lines up to weekly time frame.

Here are 2 pictures of explanation of trend following parameter, for better understanding:

trading_example.png


Example_2.png


2. Hedging option:
There is also an option to hedge trades now. How this works is, is that you can chose after how many losing trades, a hedge option should be activated.
For example: Let's say you trade with 0,1 lots and you set in hedge parameter 4, that means that after 4 losing trades with 0,1 lots EA will open an opposite hedge order
with lot 0.5 (0.1 * 4 + 0.1). It will not open any additional trades, until hedge order and all the losing trades are closed. You have an option to set this parameter on or off.

There is also trailing stop option and trading hours option.
These are currently new bells and whistles regarding this Hedging EA.

While writing this, I just had another brain fart, to have the opposite option. Instead of EA following the trend logic, it could be used to trade only in ranging market and not trade, when trending. But for now, I'll leave it here for you guys and testing purposes, and maybe add that later. I am open for new ideas and suggestions, and further testing.
I have also added one experimental SET file, for you to start playing and testing with. Ea can be also backtested, so feel free to abuse that mt4 backtester :)


Keep us posted and best regards.


You are the person of the year !!! ))))

Great job dude, thank you for shearing it with us.

Have not been here for a while, March was busy by my regular job.
Will test your new version from monday and be back with results.

Thanks again.

25
 
Hi All,

have question regarding EA. I am testing it on pepperstone razor demo account for a day and have not gone in profit yet. Thing is that most of the time EA closes orders in too small profit or in loss. even if in profit, commission eats it all. Now I am getting message about not enough margin, however I still got 95% free equity .

Now here is my trading report and screenshot of my setup. Could you please help me to figure out and solve the issue ?

Sincerely,

25
 

Attachments

Here it is,

Completely rewritten code and also bug free now.

Additional parameters were added:

1. Trend following option:
You have now option for trades to follow higher trend. You can chose up to 3 higher time frames in parameters.
For example: 60min, 240min and 1440min, This means, trades will be only opened, when price will be above all 3 higher candles open lines.
When price will be in between, it is considered as ranging market and Ea will not take additional trades. You can also set all 3 open lines to the same time frame.
For example: 60min, 60min, 60min....this means Ea will open buys only above 60min and sell trades only below 60min. You can set open lines up to weekly time frame.

Here are 2 pictures of explanation of trend following parameter, for better understanding:

trading_example.png


Example_2.png


2. Hedging option:
There is also an option to hedge trades now. How this works is, is that you can chose after how many losing trades, a hedge option should be activated.
For example: Let's say you trade with 0,1 lots and you set in hedge parameter 4, that means that after 4 losing trades with 0,1 lots EA will open an opposite hedge order
with lot 0.5 (0.1 * 4 + 0.1). It will not open any additional trades, until hedge order and all the losing trades are closed. You have an option to set this parameter on or off.

There is also trailing stop option and trading hours option.
These are currently new bells and whistles regarding this Hedging EA.

While writing this, I just had another brain fart, to have the opposite option. Instead of EA following the trend logic, it could be used to trade only in ranging market and not trade, when trending. But for now, I'll leave it here for you guys and testing purposes, and maybe add that later. I am open for new ideas and suggestions, and further testing.
I have also added one experimental SET file, for you to start playing and testing with. Ea can be also backtested, so feel free to abuse that mt4 backtester :)


Keep us posted and best regards.
Thanks a lot!
 
Guys there is a bug in calulation of a tp in all versions placed here.
1. I noticed that in SELL order ea places some times tp above the entry line instead of below entry line. I didnt notice the same issue on Buy orders, but that needs to be checked.
2. I looked the code, it should take in consideration spread+comm+swap, but unfortunately it doesn't ...it only places 2 POINTS tp on first order which gets you in loss of 3-5 cents per 0.01 lots. So thats the reason why ea is loosing money steadily.
I am not sure when ea makes average TP for lets say 50 orders, since sometimes average tp closes all trades with minus.


Also placing a tp or a trailing parameters looks like dont have any influence on things i wrote about.
Can someone who is programmer recheck ea code and confirm this, since this is a profitable machine if u know how to use it.

I did the similar system almost 10 years ago and it was profitable, only issue was acc balance, with 50k this system is ATM. Eas presented here on forum are much better then what i used.
 
Guys there is a bug in calulation of a tp in all versions placed here.
1. I noticed that in SELL order ea places some times tp above the entry line instead of below entry line. I didnt notice the same issue on Buy orders, but that needs to be checked.
2. I looked the code, it should take in consideration spread+comm+swap, but unfortunately it doesn't ...it only places 2 POINTS tp on first order which gets you in loss of 3-5 cents per 0.01 lots. So thats the reason why ea is loosing money steadily.
I am not sure when ea makes average TP for lets say 50 orders, since sometimes average tp closes all trades with minus.


Also placing a tp or a trailing parameters looks like dont have any influence on things i wrote about.
Can someone who is programmer recheck ea code and confirm this, since this is a profitable machine if u know how to use it.

I did the similar system almost 10 years ago and it was profitable, only issue was acc balance, with 50k this system is ATM. Eas presented here on forum are much better then what i used.


Thanks for your inputs, I need to check it again.

I will see, what can be done....maybe it is worth to take another look into it.
 
Guys there is a bug in calulation of a tp in all versions placed here.
1. I noticed that in SELL order ea places some times tp above the entry line instead of below entry line. I didnt notice the same issue on Buy orders, but that needs to be checked.
2. I looked the code, it should take in consideration spread+comm+swap, but unfortunately it doesn't ...it only places 2 POINTS tp on first order which gets you in loss of 3-5 cents per 0.01 lots. So thats the reason why ea is loosing money steadily.
I am not sure when ea makes average TP for lets say 50 orders, since sometimes average tp closes all trades with minus.


Also placing a tp or a trailing parameters looks like dont have any influence on things i wrote about.
Can someone who is programmer recheck ea code and confirm this, since this is a profitable machine if u know how to use it.

I did the similar system almost 10 years ago and it was profitable, only issue was acc balance, with 50k this system is ATM. Eas presented here on forum are much better then what i used.

Yup,

I am experiencing the same.. constant loss.. Does not cover the commissions as well.
 
Hey guys,

I will wait, untill market opens again and then check the code again.
I need to see the behaviour of Ea in live environment...I will look into the problems, you guys have mentioned.
 
So guys,

You were write, I found a bug in order opening regarding spread/swap/commission/....Now it's sorted and Ea accounts for that.
Regarding points and pips calculation; since the total profit was calculated wrongly then the pip calculation that depends on it was calculated wrongly too. This is also now sorted and Ea calculates everything in pips.

Next point:
buy TP below the line
sell TP above the line
  • the expert sums up the total lots and profits. Then it adjusts the TP of the basket of orders to projected TP and the overall TP is calculated over all the orders. That is why sometimes the TP can be "on a wrong side".

  • Added an option to disable TP to be on a "wrong side" (in that case now it will set it to BE - order open price). When the "Disable setting of the take profit to "wrong side"" option is set to true, then in cases like that minimal (or maximal, depending on the order type) is the order open price (that way it can not go to the "wrong side). If that option is set to false, then the expert works as before regarding the TP

    in simple words...set the last parameter to TRUE and Ea will set orders at Break even (no more "wrong side")
    Set it to FALSE and it will work same as before.

    Another point: Regarding hidden trailing stop
hiding the tp (or sl) for can be done in a normal way when not too much orders are taken into account and when there is no "basket" type of trading included. But when any type of "basket type" trading is in the game the issue is the following.

Imagine this :
  • 100 orders
  • criteria is reached
  • expert needs to close all 100 orders (since the criteria - either to collect profit - ie : hidden tp, or to close in some loss - ie: hidden sl) and it starts to do that. And then broker returns an error at, let say, order 50.
  • now we have 50 orders opened and the criteria is not there any more and all of a sudden the expert does not "know" what to do
That is the main problem with hidden sl and / or tp when a large number of orders need to be processed at the same time to fulfill the sl and / or tp criteria : almost sure that it will end in error, and that error can lead to a disaster. I think that it is much safer to use "hard" sl and / or tp.

So here is the new corrected version, please feel free to test it and report back with your results.
It should be good enough, to collect some pips.

Lp
 

Attachments

Strange, new Ea doesnt open any orders, i tested it with default settings , everything is checked regarding mt4 default ea setting, smiley is on etc , but ea is not opening any new trades. I tried with putting ea filter option to false, but no new orders.
 
Hmm....

Is anybody else experiencing the same issue?

One issue might be,
If account is too small and you set money managment to true...there won't be enough margin for opening trades.

I will check it again in the evening.
 
Hey,

So, I have just tested EA on live Demo account, and it works as it should on my side.
Here is my screenshot from couple of seconds ago. Trades were opened immediately, after I uploaded expert advisor.

It should be traded on EURUSD pair only.
Also check, allow live trading box.

DvE26BO.png
 
haha...no problem.

I am glad, that is working for you now....please keep us posted with tests, results, opinions and so on.
 
why ea keeps sendng initial order tp to 0 even if account has commission( for example logic should be tp+0.5 pips if acc has 5 usd comm, or 1 pips(10 points) if acc has comm of 10 usd +swap)
Maybe i am mistaken but as soon as ea places order it gives him tp of 1 point or 0 pips.And thus creating loss...For example ea has 10 sell orders and i understand that it needs to make average tp for them ( 0 shouldnt be tp since commsion on all open orders will eat any profit made by ea before), but if ea opens a next order buy even if i placed tp of 2 pips(20 points) ea will still move it to zero pips tp.
 
Here is one example, ea opens bunch of buy orders, but it opens 1 sell ....and tp is placed to 0 or plus 1point...an then moved to o. Closing this order is minus for commision.

PS: MYjournal is full of order modify error 1...i gues "OrderModify attempts to replace the values already set with the same values. One or more values must be changed, then modification attempt can be repeated."


Here are my closed positions some are straight to loss
sell-tp-png.43005
 

Attachments

  • sell tp.PNG
    sell tp.PNG
    75.1 KB · Views: 284
  • straight to loss.PNG
    straight to loss.PNG
    371.6 KB · Views: 411
Last edited:
Back
Top