Please fix this indicator or EA - page 125

 
fohki:
mladen

Thanks for quick reply...

So, if previous line value is not stable, I can't review how changing line wave correctly.

I don't know why this indicator has such a spec.

I'd like to make EA using the calculated signal from this indicator.

If you could modify this indicator code for stable output.

I would appreciate the kindness of your help.

Thank you.

That is a basket trading system

Different rules to trade

 

hello mr tools

i cannot use this indicator for the mt4 latest build, can u help me with this?

Files:
 
lateral4g:
hello mr tools i cannot use this indicator for the mt4 latest build, can u help me with this?

lateral4g

Use this one : multi-ma-indicator_nmc.mq4

 
nbtrading:
That is a basket trading system Different rules to trade

Hello

For No Postfix Symbol Broker, Delete postfix "m" of the symbol's name in indicator input box.

DeepSkyBlue line shows amount of longpips, Orangenline shows amount of shortpips,Yellow line shows longpips+shortpips.

If indicator timeframe set tf=1 , easy to confirm what this is multi basket indicator had a redraw symptom.

Anybody fixes this indicator?

Files:
eurusdm1.png  35 kb
 
fohki:
Hello

For No Postfix Symbol Broker, Delete postfix "m" of the symbol's name in indicator input box.

DeepSkyBlue line shows amount of longpips, Orangenline shows amount of shortpips,Yellow line shows longpips+shortpips.

If indicator timeframe set tf=1 , easy to confirm what this is multi basket indicator had a redraw symptom.

Anybody fixes this indicator?

It is repainting becase each and every symbol that is used in calculation must also be checked for :

a) a number of changed vars (that does not have to be the same at all)

b) an exact position of a bar in some symbol data (for example time for bar 2 in current bar can be bar 3 in another bar if in the current bar there is a bar missing - frequent case on time frames like 1 minute)

All the adds significant changes to any multi symbol processing - and not all are aware that time series are not synchronized but that they have to be synchronized by users code

 

I’m having trouble getting my EA to use a basic MACD indicator to place orders. In the EA Properties you have to set the inputs to allow the EA to trade to ‘true’ (QBUY==true and QSELL==true). Also there are two states: if state==2 then the EA may open BUY tickets, if state==1 then the EA may open SELL tickets. The states are only used to show if the indicator detects a BUY situation or a SELL situation.

So to sum up, if QBUY==true && state==2 then the EA will open a BUY ticket. If QSELL==true && state==1 then the EA will open a SELL ticket. With no indicators the EA will continuously open orders, so I know my flaw is not in the order logic, it only messes up when I try to add the MACD:

MacdCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);

MacdPrevious=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1);

SignalCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);

SignalPrevious=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);

MaCurrent=iMA(NULL,0,MATrendPeriod,0,MODE_EMA,PRICE_CLOSE,0);

MaPrevious=iMA(NULL,0,MATrendPeriod,0,MODE_EMA,PRICE_CLOSE,1);

if (OrdersOpened<1)

{

state = 3;

if ( ( QBUY == true )

//INDICATOR GOES HERE!!!

(MacdCurrentSignalCurrent && MacdPrevious<SignalPrevious &&

MathAbs(MacdCurrent)>(MACDOpenLevel*Point) && MaCurrent>MaPrevious)

//END OF INDICATOR

) state = 2;

if ( (QMSELL == true )

//INDICATOR GOES HERE!!!

(MacdCurrent>0 && MacdCurrentSignalPrevious &&

MacdCurrent>(MACDOpenLevel*Point) && MaCurrent<MaPrevious)

//END OF INDICATOR

) state = 1 ;

}

My declarations:

double MacdCurrent,MacdPrevious;

double SignalCurrent,SignalPrevious;

double MaCurrent,MaPrevious;

I'm new to coding so please go easy on me!

 

Correction:

if ((QSELL == true) &&

...then the indicator. && for the QBUY as well.

 
hermes:
I’m having trouble getting my EA to use a basic MACD indicator to place orders. In the EA Properties you have to set the inputs to allow the EA to trade to ‘true’ (QBUY==true and QSELL==true). Also there are two states: if state==2 then the EA may open BUY tickets, if state==1 then the EA may open SELL tickets. The states are only used to show if the indicator detects a BUY situation or a SELL situation.

So to sum up, if QBUY==true && state==2 then the EA will open a BUY ticket. If QSELL==true && state==1 then the EA will open a SELL ticket. With no indicators the EA will continuously open orders, so I know my flaw is not in the order logic, it only messes up when I try to add the MACD:

MacdCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);

MacdPrevious=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1);

SignalCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);

SignalPrevious=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);

MaCurrent=iMA(NULL,0,MATrendPeriod,0,MODE_EMA,PRICE_CLOSE,0);

MaPrevious=iMA(NULL,0,MATrendPeriod,0,MODE_EMA,PRICE_CLOSE,1);

if (OrdersOpened<1)

{

state = 3;

if ( ( QBUY == true )

//INDICATOR GOES HERE!!!

(MacdCurrentSignalCurrent && MacdPrevious<SignalPrevious &&

MathAbs(MacdCurrent)>(MACDOpenLevel*Point) && MaCurrent>MaPrevious)

//END OF INDICATOR

) state = 2;

if ( (QMSELL == true )

//INDICATOR GOES HERE!!!

(MacdCurrent>0 && MacdCurrentSignalPrevious &&

MacdCurrent>(MACDOpenLevel*Point) && MaCurrent<MaPrevious)

//END OF INDICATOR

) state = 1 ;

}

My declarations:

double MacdCurrent,MacdPrevious;

double SignalCurrent,SignalPrevious;

double MaCurrent,MaPrevious;

I'm new to coding so please go easy on me!

How are QBUY and QSELL declared?

PS: why are you using open bar signals? It can cause a lot of false signals

 
mladen:
How are QBUY and QSELL declared? PS: why are you using open bar signals? It can cause a lot of false signals

Sorry for the delay, but I actually figured it out myself! Bet that's the first time you've heard that in a while mladen!

Thanks for replying.

 
hermes:
Sorry for the delay, but I actually figured it out myself! Bet that's the first time you've heard that in a while mladen! Thanks for replying.

:):)

Happy coding

Reason: