Forum

Lotsize calculation error

Dear coders, I'm trying to improve my Martingale EA, by adding a new SL method. Namely the x candle low for long trades, and for short trades the x candle high. If the previous trade was a winner, the EA will calculate the lotsize with this formula: lotsize = ((Risk_per_Trade/ 100.0 ) * money ) /

MetaEditor: EX4 write error

Hello traders, Last week I've installed Windows 10 (64 bit) on my trading computer. Since that moment I get an error when I compile a script, indicator or an EA. The error description is "EX4 write error". This has something to do with Windows 10, because I'm getting this error on all my MT4

Selecting all objects of a type

Coders, Could someone help me with the following? I'm using an Elliot wave script to manually label the waves. The script places 8 different objects on the chart (i,ii,iii,iv,v,a,b,c). Everything works fine, but deleting the objects is a lot work. Because I have to click on every

Lotsize calculator error

Hi, Could someone please help me with my LotsizeCalc() function. I would like to multiply my lotsize with the 'MartingaleAmount' if my last trade was a loser. If my last trade was a winner I would like to use the 'normal' lotsize. Unfortunately, when I backtest the EA I get error 4051 from the

Volume-check before opening a trade

Hello, Today I was very surprised that my EA opened a new trade after I closed the order. This did happen because the open and the close were in the same candle, which caused a positive signal of the function "IsNewCandle()". I think the best way to fix this problem is to add a volume-check in the

EA opens 2 trades in one candle.

Hi, I've programmed a really simple expert advisor. The EA opens a long position when the slow stochastics closes below the value 86. extern double lot = 0.1 ; extern double tp = 60 ; //for EURUSD M5 extern double sl = 1000 ; //for EURUSD M5 int start() { double r1 = iStochastic ( NULL , 0 , 8

EA for moving average.

Hello, I'm inside the forex world for several years, I've always traded succesfully without an EA. I would like to build an 'easy' EA, who trades automatically on the basis of a Moving average. Shortly, when the movingaverage is going down, you go short, you close the trade when the moving average