Forum

Implementing trailingstop

Hello guys, I really need help in implementing trailingstop in my bot. I want when the trade is opened, if it is a buy trade it follow the price by 45 pips and if it is a sell it; there is no error in my code but for some reason the strategy is not implementing in the tester. See my code below, i

My bot is not executing trades

My bot is not executing trades , please I need your help on this guys. See my code below: void OnTick () { // Calculate moving averages fastMA = iMA ( Symbol (), PERIOD_CURRENT , fastLength, 0 , MODE_SMA , PRICE_CLOSE ); mediumMA = iMA ( Symbol (), PERIOD_CURRENT , mediumLength, 0 , MODE_SMA

Adding trailingstop to my EA

Hello everyone, I need help with adding a trailing stop to my EA. I'm looking for assistance in identifying the problem and fixing my code👇🏼. Your support would be greatly appreciated. Thank you! double trailing_distance = 50.0 ; // Trailing stop distance in pointsif(PositionSelect(_Symbol) ==

Adding TrailingStop to My EA

Hello guys, I need help adding trailingstop into my EA. Please assist me in identifying the issue so that I can fix it and update my code.👇. if ( PositionSelect ( _Symbol ) == false ){ if (StdDevVal>StdDevAVGVal&& Ask > MaValine && MaValine > MAValue && MAValue > MAAvalue) { int ticket;

I want make my EA to stop trading when my target profit for the day has been hit.

Hello guys, please I need help in making my bot to stop trading when my target profit for the day has been reached. I have written down a few codes but it is bringing up an alert of target profit for each currency pair( It is in the picture attached ). All I want is for the bot to alert me when I

I want to make an EA that closes positions at a particular point and opens new trades.

Hello, everyone. My name is David, and although I am still learning MQL5 . I am having trouble getting my bot to close out positions. I want the ask line to cancel out any buy positions on that currency pair and switch to selling when it drops below the 50 MA (Mavalue), and the bid line to do the