Coding help - page 35

 

Help adding MaxTradesPerBar or equivalent to EA

I have no clue how to add an external variable or a hardcode to this EA that sets MaxTradesPerBar to 1. Since there is no MaxTradesPerBar setting in the code, when I test with every tick, I get tons of trades and orders on each bar that I don't want. I've read suggestions online but I don't know where to paste everything into the code (I'm new at coding). Your help is much appreciated!

Doublema_breakout_ea.mq4 - MQL4 Code Base

 
mladen:
kemal44

Here is a link to a thread where it is explained how to use functions in code : https://www.mql5.com/en/forum/173005

It is explained very good there (and more than I can explain in one post) how to use them

Actually I read document prepared by you and read C++ void function but I couldnt make it possible to work ,

it seems that I will continue manual trading regarding TS part

 

Expert Advisor sub window

How do you place an info panel in a sub window on an EA, does anyone have an example?

 

...

You can use something like this in the :

int countOpenedOnACurrentBar()

{

int openedAtBar = 0;

datetime startTime = Time[0];

datetime endTime = Time[0]+Period()*60;

for(int i=0; i < OrdersTotal(); i++)

{

if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) break;

if(OrderMagicNumber() != MagicNumber) continue;

if(OrderSymbol() != Symbol()) continue;

if(OrderOpenTime()=endTime) continue;

openedAtBar++;

break;

}

return(openedAtBar);

}

[/PHP]

It will count how many orders were opened on a current bar and then you can restrict that number to any number you wish (you can extend the condition to open a new buystop or sell stop to something like this (kust an example not an actual code):

[PHP]if(CheckEntryCondition("BUY") && countOpenedOnACurrentBar()==0)

{

...

}

if(CheckEntryCondition("SELL") && countOpenedOnACurrentBar()==0)

{

...

}

megamixx:
I have no clue how to add an external variable or a hardcode to this EA that sets MaxTradesPerBar to 1. Since there is no MaxTradesPerBar setting in the code, when I test with every tick, I get tons of trades and orders on each bar that I don't want. I've read suggestions online but I don't know where to paste everything into the code (I'm new at coding). Your help is much appreciated! Doublema_breakout_ea.mq4 - MQL4 Code Base
 

...

increase

What do you consider an "info panel"?

If it is what usually is written out as comment in the main window, then, if you wish it be displayed in separate window, it must be made as objects (comment unfortunately always goes to main window)

increase:
How do you place an info panel in a sub window on an EA, does anyone have an example?
 

Hello all...

Can someone pls help me to convert the excel formula that I attach into an indicator for metatrader?

It repaints because make a projection of the last available value.

But it traces a cycle indicator and its momentum very clear and precise.

I think it will be useful for all, especially when used in combination with other indicators such as the DSS Bressert, MACD and moving averages.

Here is excel indicator:

cycleok.xls

Here is an image

Thanks to all

Files:
cycleok.xls  505 kb
immagine.jpg  108 kb
 

translation from ninjatrader to metatrader4

can someone do this with a median-renko-code?

 

bulls value and bears value indicator for the 1 hour time frame and multiple pairs

Hi,

I was wondering if someone can help me out here, I would like an indicator to show me the bulls value and bears value of the 1 hour time frame of multiple pairs if possible even just eur/usd , gbp/usd, aud/usd, eur/jpy

i would like it to be displayed on the top right hand corner of the chart and look something like this format quite big also, so i can read it

eur/usd - bulls = 232, bears = 112 up arrow in green if over 200 value

gbp/usd - bulls = 178, bears = 87 sideways arrow in yellow if its below 200 value

aud/usd - bulls = -123, bears = -265 down arrow in red if its below -200 value

i hope that you understand my request above,

the values of the bulls and bears for the non jpy crosses look like this, 0.0025 for bulls and -0.0025 bears

i need the values to be multiplied by 100000 to show them as whole number like this 250 and -250 respectively.

for the jpy crosses the value is 0.25 bulls and -0.25 bears, need to be multiplied by 1000 to show whole number as

250 and -250.

I hope i have not confused you already

If the value is > 200 its green if its -200 its yellow for flat trades

let me know if you have any questions about what i am asking for

looking forward to your reply's

thanks

 

(req) coding modification help

Hi mladen again

I recently download one of your written indicator from your many years thread before, is this indicator use future data to reloop itself? (i have no complete decomplier)

could you let this indicator not reloop or repaint past?

can you modify it to a version, so that i can input my prefered pairs?(instead those three default pairs i cannot change myself), may be four or five pairs maximum.

also can you modify to another new version , just show current pair under the chart (i.e. not multiple pairs, just the one pair under the chart)?

can alert added when line cross?

many thanks for help

 

this is in my collection

what it DOES, it got a plain chart (candle) behind (background) in main window == so you know how is another pair doing

in INPUTS , you could really pick the currency pair (2nd one) that you wanna to see

is it useful--- well , will NZD follow every AUD move

in MQ4 coding, there is one that call external pair (pair 2) to go inside to the code of PAIR 1 -- sound like a powerful KEYWORD

with the recent SINGLE direction movement, I start to

RETHINK

== should we have a template that we stick to any 1 of the direction

i.e. say, this template, I will only BET -- up

I was doing oke with ranging progressive market, never good with TREND market condition -- it will take me a long time to GO BACK to practice on DEMO again (prepare to totally loss this micro-lot real account)

hope you like it

Files:
subchart.ex4  10 kb