Hapu Arachchilage Tharindu Lakmal / Publications
Codes
Check Last Closed Trade (Profit / Type / Symbol etc.) for MetaTrader 5
Select the last closed deal (trade) to further work
Code blocks for "Counters" like Count "X" time and pass for MetaTrader 5
Here are some examples of codes for set counters based on "Count"
A Code block to detect A "New Candle/Bar" using bars history (very effective way) for MetaTrader 5
If you only want to execute your code blocks "only once per bar" it's important to check if there is new bar arrived or not
Code Block for "Trailing Stop" based on current market price. (Ask / Bid) for MetaTrader 5
This code block loops through all opened position and do trailing based on Ask and Bid prices
Simple Code for Detect A "New Bar or New Candle " Received for MetaTrader 5
This code block detects a New Bar or a New Candle when it has received
Forum
How to avoid this product rules being breaking for my EA?
The product rule -: " Embedding any limitations by time, account type or number, financial instrument, etc. into your Program is prohibited. All such actions will be considered as unfriendly to the Buyer and are prohibited. " I want to code an EA to work only on special instrument also in specific
Adding External Link to a product description
I have a product which works if use with the proper strategy. but the strategy is in pdf format. I've already uploaded it in my Google Drive. can I put the Google Drive Link in my product description so people can download the strategy there? As I know the MQL has updated polices for the product
Why this mql4 code does not draw color candles in MT4
I want to draw color candles in MT4. but the bellow code doesn't do anything. The code doesn't return any error but not work as expected. Can someone tell me what the issue is? I tried with ChatGPT to find an answer, it doesn't give any correct answer for this
Are there any methods to get the angle of a trendline?
I have drawn a trend line in the bellow chart. I want to know the angle of this trendline so I can use it to trade based on some other conditions. but I don't know how to calculate it. do you have any idea how to do this. I don't need you to code for me. give me an idea how to do this. Your help is
I'm tired of trying to draw arrows in my sub window. Help me with this :-(
I tried bellow code, nothing is happening. When I check object list, arrow object has created but it's not visible anyway in the sub window no matter how. the object's time coordinates are always showing as 1970.01.01 not matter how I try to set it to the current date time. the arrows I'm trying to
How to resize the chart using MQL5?.
if the chart height is 250 pixels and width is 450 pixels when my indicator applies to the chart, I want my indicator to resize the chart height to 450 pixels and width to 720 pixels. How can I achieve this? I have tried to do this way, but nothing is working. it is possible to resize the chart size
Why this completely upside-down results show on Strategy Tester?
All the testing parameter was same. except the modeling. I'm fully confused with these upside-down results. Can someone please tell me why is that? Results of Modeling - "Every Tick" Results of Modeling - Every Tick based on real ticks
How to calculate leverage adjusted lot size ?.
Lot size = Risk Money / ( Stop Loss Distance * Tick Value) This formula retrieves the lot size. Since Price levels are same and tick values are same for every broker that lot size is the common lot size . But the required margin for that lot size could be different due to the leverage of the trading
Why this code block not calculated the lot size correctly?
I use this code block to calculate the lot size. but when it comes to indices the calculation is very different. as an example, this code block calculates lot size for 10,000$ account with 1:500 leverage is around 3.0 lots. but when it comes to balance 6,000$ with 1:100 leverage , the code is
Can we trust the strategy tester?
I'm tested an EA using a VPS for a week. the EA ended up with loses ( -30.00$ ). then I did a back test for same week with same EA and with the same parameters that used to trade on live trading. but the strategy tester showed me positive results ( +280.00$ ). The strategy was developed by me. so
