I wrote an indicator that draws symbols on the chart once I draw a trendline. I wrote in the OnChartEvent function to run the code every time I drag the trendline. It works finitely many times, and then all of a sudden the symbols on the chart are
I'm coding an EA and I have a margin check within my EA to make sure I have enough margin to enter a trade. But for some reason I always get an insufficient margin, and I have no idea what's wrong. Here is my code: //checks if we can
ObjectDescription takes one input-the name of an object. What if I have multiple objects, each on different charts, with the same name? How do I distinguish them
If I have an EA that enters trades on a specific magic number , say 1000, then can I have multiple orders with the same magic number? Even if they are different order types? (buy limit, sell stop, etc) and even if its different symbols
I'm coding an EA based on price action, but I have one part where I need to record a "signal bar," (for example a pin bar or a second bar of a 2 bar reversal). So if I see such a bar, I can assign the value iTime of that bar to a global variable
Suppose I draw a trendline, and I want an indicator that can draw lines above and below it by x pips. So I first find the trendline, take its price and time values, and calculate slope, then plot the lines. However, certain instruments close early on
Is there an indicator that can label bars? Like you input a value, say 100, and the last 100 bars from the current bar are labelled 1-100. It would be really helpful for analyzing past trades/past market conditions. Can someone show me how to code
I'm using an indicator called 10.2 TMA slope, and although it compiles without errors, and even works in an EA, when I backtest my EA, a whole bunch of error messages pop up in the journal saying, \ 10_2 TMA slope v1_4B 4_30 for EA EURUSD,H4: unknown
Hi guys, I'm trying to code the double bottom chart pattern using fractals, and although the compiler says there are no errors, it doesnt seem to work in an EA. can you help me figure out whats wrong? bool doublebottom() {
My EA has only up to one trade opened at any moment, but on certain bars it opens and closes mutliple trades, probably as many as the ticks in that bar. How can I prevent more than one or two trades opening in one bar
suppose I want to close a trade in n bars (say n=5) if the price doesnt move at least 15 pips in my favor. How do I code that? I know for the trade entry price I use OrderOpenPrice() but how do I get the iClose for the next few bars? its
suppose I want to enter a trade when one condition just occured and another occured in the last 4 bars. how do I code that? for example, if I want to buy if stochastic crosses above 20, and RSI crossed 30 in the last 3 bars, do I need to define RSI
for the ordersend function , how does the expiration time parameter work? if I put in an integer like 5, does it mean the pending order will be canceled after 5 bars
Does anyone know what this error means? I'm trying to set lotsize to be at fixed leverage, so I put double Lots; Lots=NormalizeDouble(((leverage*AccountBalance()/100000),2),2); its rounded to 2 decimals. but I get an error saying
Suppose I want to use a custom indicator -like a certain type of moving average- on RSI values. Then I need to set the RSI values in an array, and apply the moving average on that right? How do I do that? iCustom doesnt allow me to apply indicators
you know how on the charts, you can apply one indicator onto another by clicking, "apply to first indicator's data?" how can you do the same for programming in mql4? For example, I want to create a strategy that involves bollinger bands on
When I am writing the code for an expert advisor, how do I apply an indicator on the data generated by another indicator? for example, putting bollinger bands on RSI. because in the iBands functions, you need to put the symbol name. Any help is