Forum

MT4 opening and closing trades at the same time? Why?

I'm working on creating an EA that purchases long when the price (close) crosses above the MA line and closes the trade when the price (close) crosses below the MA line. My issue is that when I run the strategy tester , it is opening and closing the trade immediately. I've used an online generator

How to make date comparison

I've created an EA that works very well in backtesting . However, I have a different program that I use altogether which I use to signal GREEN/RED. Green is when I consider the market conditions favourable to go long stocks. Red is when I go to cash. I would like to incorporate the two systems while

How to trade at a certain time of day?

I'm creating an EA for training. I've created an EA that has been 100% accurate since 2012. It's based on the daily chart, but there have been HUGE drawdowns. One thing that I've noticed is that my trade conditions are triggering during the day, but based on the value of the candle at the end of the

Can someone please look at this and tell me how it recorded a loss?

I'm created an EA and backtesting it... Can someone please look at trades 5 & 6 and tell me how that trade resulted in losing $20? I can't figure it out. The trade was closed under where it started by 20 handles and it still resulted in a loss. That doesn't make sense to me

iHighest / iLowest isn't working correct (or as expected).

I'm creating a function to try and return the PriceRank of the current symbol. By using the IV Rank calculation, I want want to calculate the Price Rank. I've used it, but some how, I'm getting higher current Closing prices than the Highest within the last 52 weeks. Can someone tell me what I'm

How to stop triggering on a re-print?

I'm currently setting up a buy order when a certain condition is true. The problem I'm running into is the stoploss is triggering and then trying to re-purchase the buy order right away. So, the end result is multiple trades per day that is just eroding the capital. How can I put something in my

Can I view the value of all variables?

I'm looking for a way, that at any point I can press "stop" and then see what the current value of all my variables are. Or, for debugging purposes, is there a way that I can create a line in the journal that prints the value of all variables (or anything I want really)? For example, I'm basing on

No experience with enum. Quick question.

I was looking for a way to create a combo box for the input variables. I came across the following example: enum __in{ _p1, // value 1 _p2, // value 2 _p3, // value 3 _p4 // value 4 }; extern __in check = _p1 It works beautifully and I have adapted it for my needs. My question is... What is

Can I analyse stocks?

I'm looking to create an EA that uses the results of analyzing actual stocks (not CFD's or futures). Is this possible in MT4? Is there a way that I can have my MT4 look up say the value of TLT to execute a pre-determined rule that I have? For example: if TLT goes down and TBT goes down then do