If you're diving into automated trading, you're going to want to check out this Expert Advisor based on the Candle Shadow Percent indicator. This EA calculates your lot size based on a risk percentage of your available margin, making it a handy tool for risk management.
Important: This Expert Advisor assumes that the Candle Shadow Percent indicator is stored in the \Indicators\MyInd\Candels folder, as highlighted in the OnInit() function.
m_money.Percent(Risk); //--- create handle of the custom indicator handle_iCustom=iCustom(m_symbol.Name(),Period(),"MyInd\\Candels\\Candle shadow percent", __1__,
If your indicator is saved in a different folder, don’t forget to update the path in OnInit.
This EA only triggers actions upon the formation of a new candle; it won’t operate within the current bar. So, it’s crucial to understand the opening conditions for your positions:
- If the value of the "Candle Shadow Percent" indicator on the previous bar (indexed 1 in the 0 buffer, or "BufferTop") is not zero, it indicates an arrow on that bar, and a Sell position will be opened.
- If the value of the "Candle Shadow Percent" indicator on the previous bar (indexed 1 in the 1 buffer, or "BufferLow") is not zero, it indicates an arrow on that bar, and a Buy position will be opened.
For those debugging: I recommend tweaking the parameters for the upper shadow first, followed by the lower shadow. It’s all about getting that fine-tuning right!

Comments 0