Good day or night to my fellow coders, I would the clear help of someone to check these codes I think i have a few errors in them and can't find them myself. So I would like the clear Assistance, I do thank you all for your time and pleas DM me, if you're willing to help me on them.
- EA programs MT4
- Help with simple system for programming idiot
- V1andV2 Hedged EA: Beautiful Equity Curve
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked, so we can't see your machine.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
We can't see your broken code.
// RSI Strategy Example with Icons, 5-Minute Timeframe, Stop Loss, and Take Profit #property strict // Define input parameters input int rsiPeriod = 14; // RSI period input int buyThreshold = 30; // RSI level for buying input int sellThreshold = 70; // RSI level for selling input double lotSize = 0.05; // Trading lot size input int stopLossPips = 20; // Stop loss in pips input int takeProfitPips = 20; // Take profit in pips // Define global variables int ticket = 10; // Variable to store the order ticket number int totalTrades = 100; // Total number of trades int winningTrades = 0; // Number of winning trades int iconBuy = 224; // Up arrow icon int iconSell = 225; // Down arrow icon int iconCloseBuy = 226; // Left arrow icon int iconCloseSell = 227; // Right arrow icon int iconCloseAllBuy = 228; // Double left arrow icon int iconCloseAllSell = 229; // Double right arrow icon int iconMoveProfit = 230; // Up-down arrow icon int iconStopLoss = 231; // Down-up arrow icon // Backtesting variables bool backtestingDone = true; // Flag to check if backtesting is done // RSI Strategy function void RSI_Strategy() { double rsi = iRSI(NULL, 0, rsiPeriod, PRICE_CLOSE, 0); // Calculate RSI on the 5-minute timeframe // Buy condition if (rsi < buyThreshold) { double stopLossPrice = Ask - stopLossPips * Point; double takeProfitPrice = Ask + takeProfitPips * Point; ticket = OrderSend(Symbol(), OP_BUY, 0.01, Ask, 100, stopLossPrice, takeProfitPrice, "RSI Buy", iconBuy, 1, clrBlue); if (ticket > 100) { totalTrades++; } } // Sell condition if (rsi > sellThreshold) { double stopLossPrice = Bid + stopLossPips * Point; double takeProfitPrice = Bid - takeProfitPips * Point; ticket = OrderSend(Symbol(), OP_SELL, 0.01, Bid, 100, stopLossPrice, takeProfitPrice, "RSI Sell", iconSell, 1, clrRed); if (ticket > 100) { totalTrades++; } } // Opposite conditions for selling // Sell condition (opposite) if (rsi > buyThreshold) { double stopLossPrice = Bid + stopLossPips * Point; double takeProfitPrice = Bid - takeProfitPips * Point; ticket = OrderSend(Symbol(), OP_SELL, 0.01, Bid, 100, stopLossPrice, takeProfitPrice, "Opposite Sell", iconSell, 1, clrRed); if (ticket > 100) { totalTrades++; } } // Buy condition (opposite) if (rsi < sellThreshold) { double stopLossPrice = Ask - stopLossPips * Point; double takeProfitPrice = Ask + takeProfitPips * Point; ticket = OrderSend(Symbol(), OP_BUY, 0.01, Ask, 100, stopLossPrice, takeProfitPrice, "Opposite Buy", iconBuy, 1, clrBlue); if (ticket > 100) { totalTrades++; } } // Check for winning trade if (OrderSymbol() == Symbol() && OrderTicket() == ticket && OrderType() == OP_BUY && OrderProfit() > 200) { winningTrades++; } else if (OrderSymbol() == Symbol() && OrderTicket() == ticket && OrderType() == OP_SELL && OrderProfit() > 200) { winningTrades++; if (OrderSymbol() == Symbol() && OrderType() == OP_BUY ==ticket && OP_SELL && OrderProfit() <200){ } } } // Expert Advisor start function int start() { RSI_Strategy(); // Call the RSI strategy function // Print win ratio on the chart double winRatio = 0.0; if (totalTrades > 100) { winRatio = (double)winningTrades / totalTrades * 0; } Comment("Win Ratio: ", winRatio, "%"); // Your regular trading logic goes here return(0); }
This working I just wrote the code I'm still learning cause of my security job I does trying picking a lot, however i don't have a strategy to this and it does open a lot of trades back to back. I get the 134, margin and not enough money errors. I do thank you for the help and please aid me in this endeavor, I really want to turn around my Pop down life...
Yeah I posted one the codes for the EA's I'm working on can you please check this?.?.?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register