Coding help - page 43

 

...

The versions posted there do not repaint

And when the indicator you posted gets corrected then you get the indicators from the link provided : that is when it ("solar wind") becomes a non-repainting and correctly coded indicator

annbeea:
Hi mladen,

thanks. I see the link you provided, and there is " none of these two indicators does not repaint" , so are the two indicators there repaint or non repaint, i am little bit confused now", thanks for clarify.

by the way, can the trendalt_alert indicator modify its code to non-repaint version as well? Many thanks.
 

Only one alert a day

Hello,

I have an EA with 2 conditions on a daily TF that alert each time (tick) when the 2 conditions are right.

I want to have an alert the first time and no more for the day.

What code can I use.

Thanks in advance.

Jo

 

...

You simply have to limit it to alert only once per daily time frame bar

Do something like this :

static datetime lastAlerted = 0;

if (yourAlertCoditions == true)

if (iTime(NULL,PERIOD_D1,0) != lastAlerted)

{

lastAlerted = iTime(NULL,PERIOD_D1,0);

... // your alerting code

}

Jovager:
Hello,

I have an EA with 2 conditions on a daily TF that alert each time (tick) when the 2 conditions are right.

I want to have an alert the first time and no more for the day.

What code can I use.

Thanks in advance.

Jo
 

this ea is wonderful, make it workabal in live or real account 95% accuracy

this ea works eurusd 1 min worderful ,in demo account but dont put trade in live account so please somebody make it workabal to live or real account

my mail id is jitupathak8@gmail.com

reply me thanks

Files:
 
mladen:
You simply have to limit it to alert only once per daily time frame bar

Do something like this :

static datetime lastAlerted = 0;

if (yourAlertCoditions == true)

if (iTime(NULL,PERIOD_D1,0) != lastAlerted)

{

lastAlerted = iTime(NULL,PERIOD_D1,0);

... // your alerting code

}

Many thanks Mladen. I will try soon.

Jo

 
mladen:
You simply have to limit it to alert only once per daily time frame bar

Do something like this :

static datetime lastAlerted = 0;

if (yourAlertCoditions == true)

if (iTime(NULL,PERIOD_D1,0) != lastAlerted)

{

lastAlerted = iTime(NULL,PERIOD_D1,0);

... // your alerting code

}

Mladen, you are great.

Thanks again.

Jo

 

Detect an open position?

Hi

I want to know, when a position is opened, what is the instruction can detect a new order?

for example I want to write a simple sample that show a message when a position is generated.

Thanks for your help

 

Hello all,

I'm looking for advice regarding modifying my SL order.

Using an uptrend as an example, I want to reposition my SL below each preceeding swing low. I have coded this as follows: when a MACD golden cross is formed, the SL gets modified to the low preceeding that cross. The EA uses the preceeding 10 bars for the lowest low.

But I want to further elaborate on the code by using the ZigZag indicator and waiting until price has closed above the high. So once a MACD golden cross has formed, I then wait until price closes above recent high, and also ZigZag must have identified the low as well.

Any ideas how I would go about coding this? I have done this so far:

if (OrdersTotal() > 0)

{

if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES))

{

if OrderType() == OP_BUY)

{

if (UpTrend == true && DownTrend == false && FastMACurrent > SlowMACurrent && MacdCurrent > SignalCurrent && MacdPrevious < SignalPrevious)

{

if (OrderStopLoss() != GetStopLossLong (TimingChart, TimingChartShift, SL_Period))

{

OrderModify(OrderTicket(), OrderOpenPrice(), GetStopLossLong (TimingChart, TimingChartShift, SL_Period), OrderTakeProfit(), OrderExpiration(), Green);

Thanks,

 

Hello all,

I've come across a problem with my code.

What I want to do is determine the longer term trend on the H4 chart to filter out short/ long positions on shorter timeframes. I do this by using a donchian channel rather than MA's; price in an uptrend until it breaks the lower band. price in a downtrend until it breaks the upper band.

Anyway I do this by using the following:

//--- Determine trend direction on H4 chart

TrendDonchian_Low = Low;

TrendDonchian_High = High;

static bool TrendChart_UpTrend = false;

static bool TrendChart_DownTrend = false;

if (Ask > TrendDonchian_High) {TrendChart_UpTrend = true; TrendChart_DownTrend = false;}

if (Bid < TrendDonchian_Low) {TrendChart_UpTrend = false; TrendChart_DownTrend = true;}

Then when testing for a position I use..

//--- Check for long entry possibility

if (OrdersTotal() < 1)

{

if (TrendChart_UpTrend == true && TrendChart_DownTrend == false &&...

But its not working. Any ideas?

 

Weekend Learning !

Hello Masters

I wanted to put this indie on main chart but problem is it's name mix with EURUSD O H L C (Attached image) !

What should i do to change in code to hide indie name on main chart so it looks like chart window indicator !

I am not coder so any help would be appreciated.

Thanks in advance

secretcode

Files:
indie_name.gif  27 kb
progo.mq4  2 kb