1mathboy1
1mathboy1
1mathboy1
Added topic Why doesn't OnChartEvent continue working?
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
1mathboy1
Added topic Problem with checking margin
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
1mathboy1
Added topic Why does ObjectDescription only require one parameter?
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
1mathboy1
Added topic Can magic numbers be used for more than one order?
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
1mathboy1
Added topic Is there a way to record a bar using iTime?
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
1mathboy1
Added topic How do I calculate values on a trendline?
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
1mathboy1
Added topic Is there an indicator to label bars?
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
1mathboy1
Added topic unkown subwindow number -1 for object create function error
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
1mathboy1
Added topic Problem with code-wont work in an EA
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()    {   
1mathboy1
Added topic how to prevent multiple trades in one bar?
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
1mathboy1
Added topic closing a trade within n bars?
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
1mathboy1
Added topic saving visual testing charts?
After running a visual test of an EA, is there a way you can save the chart so you can open and use it again? and analyze trades
1mathboy1
Added topic adding comments to code/orders?
How do I make an EA give comments so that I know how the trade was closed? (like if it was from trading condition 1, 2, 3, etc, which you coded.)
1mathboy1
Added topic programming question?
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
1mathboy1
Added topic order expiration time?
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
1mathboy1
Added topic "no Ivalue present" error
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
1mathboy1
Added topic How do I apply a custom indicator to a an array?
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
1mathboy1
Added topic Applying one indicator on another indicator?
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
1mathboy1
Added topic optimizing EAs?
How do I optimize EAs on metatrader 5? on my program, there is no optimizer bar on the strategy tester . I am using metatrader 5 build 787
1mathboy1
Added topic How to apply an indicator on top of an indicator?
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
12