Coding help - page 346

 

So in the tester works properly

ticket = OrderSend(_symbol,OP_BUYSTOP,_volume,NormalizeDouble(_priceop,Digits),_slippage,0,0,_comment,_magic,_expiration,_arrow_color);

changed to

ticket = OrderSend(_symbol,OP_BUYSTOP,_volume,Ask+Point*30,_slippage,Ask-Point*30,Ask+Point*70,_comment,_magic,_expiration,_arrow_color);

why not work with NormalizeDouble(_priceop,Digits)

 
xan023:
So in the tester works properly

ticket = OrderSend(_symbol,OP_BUYSTOP,_volume,NormalizeDouble(_priceop,Digits),_slippage,0,0,_comment,_magic,_expiration,_arrow_color);

changed to

ticket = OrderSend(_symbol,OP_BUYSTOP,_volume,Ask+Point*30,_slippage,Ask-Point*30,Ask+Point*70,_comment,_magic,_expiration,_arrow_color);

why not work with NormalizeDouble(_priceop,Digits)

That EA seems to be designed top open pending orders on a stop level distance. And it seems that the data returned from a function that checks the stop level of your broker for stop level distance is not quite exact if the EA can not open an order

 

Good job, dedicated help from fellow programmers...that is nice.

 

Can Someone help, I found one trading strategy that is so good on M5,most especially if you are contended with making 5 to 10 pips profit at a go.I tried to convert to EA, it compiled right, but it doesnt respond to backtesting and trading.I have attached it along with this post.

nicetrader.mq4

Files:
nicetrader.mq4  26 kb
 

Hi Mastercash,

I was able to download and run the NiceTrader EA in the Strategy Tester with no problems.

I just used the default settings and did not change anything...and did not get any error messages.

I did not try to run it real time on my demo...but this EA works fine with the Strategy Tester. See attached chart...

Do you get any log error messages or other clues why it's not trading for you...?

Hope this helps,

Robert

Files:
 

Cosmiclifeform

Thank you,may be because Im using live account chart(alpari uk) to test it.let me try the demo.I coded the ea in an hurry,I will appreciate if others can still go through the code and see if there should be any adjustment.

,

cosmiclifeform:
Hi Mastercash,

I was able to download and run the NiceTrader EA in the Strategy Tester with no problems.

I just used the default settings and did not change anything...and did not get any error messages.

I did not try to run it real time on my demo...but this EA works fine with the Strategy Tester. See attached chart...

Do you get any log error messages or other clues why it's not trading for you...?

Hope this helps,

Robert

 

Stops 2 to 3 pips function MarketInfo(_symbol,MODE_STOPLEVEL) returns a value of zero

 
xan023:
Stops 2 to 3 pips function MarketInfo(_symbol,MODE_STOPLEVEL) returns a value of zero

Sometimes that function depends on the broker - with some brokers it returns correct values, with some no

 

thanks for the help mladen it works

 

I changed lines

int _stoplevel=MarketInfo(_symbol,MODE_STOPLEVEL);

to

int _stoplevel=30*Point;

Reason: