Forum

"hedging" in MT5

I have a strategy in mt4 and I would like to move it into mt5, but i have some concerns. Tell me are there any brokers with mt5 demo that allow to trade (EA) like this: buy 1 lot @ EURUSD and then sell 1.2 lot @ EURUSD while 1st position is still opened. Both positions have managed their SL and TP

better Zig Zag

Is there anyone that is in possession code for any kind of indictor similar or the same as ZZ, which wouldn't omit the some highs/lows? and which would work on closed candles so it wouldn't change its past values(of ZZ)

How to make the function not to return 0?

How to make the function not to return 0 val when Vol >1 ?? double MTRd() { int i; int n= MathRound ((MTRperiod- 1 )/ 2 ); if ( Volume [ 0 ]< 1 ) // calculate only when the new bar appears { double c; double Ext[]; ArrayResize (Ext, 0 ); //reset old values ArrayResize

optimization of code

Hi, I found somewhere there that i way to optimize the code is to use multiple if() instead of &&. So I made changes in my code and stopped working properly. So where is the bug? Plz help This worked slowly but properly void SLman() { int type, ticket; int total = OrdersTotal (); double

Problem with array

Hi all. Plz explain to me if this code should work. I want to use ZigZag to manage SL. In order that i look for 3 last value>0 of the indicator. Than I want to use this 3 values in further conditions. Will this 3 val change in every thick? (I copied essential part of code, because whole thing has

commet when opening trade

Hi, I would like to have comments when opening trade ( backtesting ). It will be indicators values like below. string comment= ( " ATRd " +ATRd+ "\n" " MomentumD1down " +MomentumD1down+ "\n" " MomentumD1up " +MomentumD1up ); string comment= ( " ATRd " +ATRd); input

one trade a day

Plz tell me why doesnt it work. I mean if there is opened trade in today, dont open any until next day. bool OneTradeAday() { if ( OrderSelect ( 0 , SELECT_BY_POS,MODE_HISTORY)==False) return (True); if ( OrderSelect ( 0

Backtesting - fixed lot or fixed risk?

Hi For real trading the answer is obvious - fixed risk per trade, but what with backtesting ? Wont it distort the results of EA? For the purpose of rating the EA which method is better

Double top function

Hi all I trying to code the condition of finding DT. I want to check previous 40 bars starting from 6th bar to find the one(H1) with max equals to previous d1 bar. Then I want to check if neck of double bottom is over 20% of average daily range if conditions are met return True. Plz help bool DT ()

time condition

Hi. I would like to add to my open conditions sth like that: OrderOpenTime() of last trade + 4 Hours <= TimeCurrent() plz help