DislikedHello Everyone, I have reached here as I thought it was the most appropriate place to post this. I have put together an EA using some ideas and codes taken here and there that simply perform some actions for manual trading via buttons. I am to the point I don't really know how to improve it, it is not performing well for some reasons (most likely badly coded by myself). Is anyone able to help fix it? ...or maybe point me out to where I could post for help? Thank you {image} {file}Ignored
Inserted Code
void OnTick()
{
RefreshRates();
// Spread Text
double spread = (Ask - Bid) / Point;
ObjectSetText("ButtonEA-Spread_00_Label", StringSubstr(Symbol(),0,3)+"/"+StringSubstr(Symbol(),3,3)+ " Spr " + DoubleToStr(NormalizeDouble(spread / divider, 1), SpreadDigits) + " pt", add_text_size+1, sFontType, clrOlive);
// Profit Text
//start();
//
if(Bars<100 || IsTradeAllowed() == false)
return;
if(CalculateCurrentOrders()!= 0) SetSLnTP();
} Pardon me as I didn't have time to look in detail, but I notice this part of the code is executing on every tick. Looks like for every tick, you are refreshing rates and then checking for open orders, setting their SL and TP. Perhaps it doesn't need to be executed that frequently, you can place it in onTimer() to execute it once every few seconds or once every minute instead? Depending on your requirements.