DislikedHi all, i am no expert coder, barely know coding and currently using CHATGPT to code my idea, currently quite profitable on demo with no interference, but i can be much more profitable if i can get chatgpt to achieve a cooldown strategy after a loss, seems it is struggling with this as it never works, can anyone assist. So what i basically just want is, that after a loss, no matter the size, it must not take any trades without a certain time period with an input field?Ignored
So, AI needs to create a function similar to this one:
Inserted Code
void OrdersLossInDay()
{
int cnt;
int TradeLoss=0;
int hstTotal=OrdersHistoryTotal();
for(cnt=0;cnt<hstTotal;cnt++)
{
if(!OrderSelect(cnt, SELECT_BY_POS, MODE_HISTORY)) continue;
if (OrderMagicNumber()==MagicNumber)
{
if ((StringFind(OrderComment(),"[sl]",0)>=0 || OrderProfit() < 0) && TimeDay(OrderCloseTime())==Day()) TradeLoss++;
} // if (OrderMagicNumber()==MagicNumber)
} // for
if ( TradeLoss == MaxLossesTradesPerDay ) TradeStatus = 0; // disable trades
//Print("TradeLoss = ",TradeLoss);
} And the AI can then use Sleep(int milliseconds);
BTW. Notice that if the EA is using TS, then SL may not be a loss, but a profit, so you also need to decide if you want to use this method, or only OrderProfit()<0.
.ex4/.ex5 files can't be fixed or modified / I'm not a coder!