[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 362

 
Vinin >> :

Something like that worked out for me.

>> THANK YOU VERY MUCH!

 

Good afternoon!

Took a demo on Alpari today and was surprised by five decimal places. I had to redo the EA, add a ten.

If it is not difficult to explain the difference between five and four decimal places or give me a link where you can read about it.

 
gvi2504 >> :

Good afternoon!

Took a demo on Alpari today and was surprised by five decimal places. I had to re-do the Expert Advisor, add a ten.

If you don't mind explaining the difference between five and four digits, or give me a link where I can read about it.


This is what I do - I set start() at the very beginning (probably better in init() ?):

// ```````````````````````````````
   double PointX = 0;
   if(Digits==5 || Digits==3) {
      PointX = Point * 10;
   }
   if(Digits==4 || Digits==2) {
      PointX = Point;
   }
// ```````````````````````````````


And then I use "PointX" instead of "Point".

 
chief2000 >> :


This is what I do - I set start() at the beginning (probably better in init() ?):


And then I use "PointX" instead of "Point".





Thank you very much.

 
Shniperson писал(а) >>
>> Gentlemen. how to make the values of bars on H1 be taken into account when trading on H4 ? for example if(......&& Close[0](bar H1)>High[1](bar H1) ???????????

roughly here... however this is an example of working code for macd & ) || ( this underlined place combines the condition of the specific code

indicator>0 && indicator<=Signalindicator && indicator>Signalindicator unites H4 with H1 in the sense that the situation in H4 and in H1 is the same for MAKD (or not - it depends on <=0 (less or equal to zero / possible to MAKD) besides &&(simultaneously) allows to complicate the relationship)

MacdCurrent=indicator_MAIN,0);
MacdPrevious=indicator_MAIN,1);
SignalCurrent=indicator_SIGNAL,0);
SignalPrevious=SIGNAL indicator,1);

total=OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderType()<=OP_SELL && OrderSymbol()==Symbol()) // check for symbol
{
if(OrderType()==OP_BUY) // long position is opened
{
if((indicator>0 && indicator<=Signal indicator && indicator>Signal indicator) || ( indicator<=0 && indicator>0))
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position

But this code is someone else's and I am unable to change it myself, that's for sure.

 
JEKA писал(а) >>
Hello, I think the question is more for advanced programmers than for beginners like me, although my idea will be useful to both! So the essence of the question, is it possible to write an indicator or advisor based on two indicators? V-TBv6.ex4, 5_ZZ_Semafor.ex4 I would like to write it myself, but k sozhily I do not possess such knowledge, and I would like to seek help from those who also interesesito this idea or to those who have the necessary knowledge in this area.

there is a trading advisor on ma and mcd.

Ma for opening, Maqd for closing

Ma are used simply on the opening in the code for the Open Position (in the scripts that come together with the terminal these are Ma and Poppy), a block in which an indicator (Ma) goes to the Close (Poppy).

if two indicators are required at the same time, two indicators are declared in the required block and their values are combined via

void CheckForClose()
{
double MacdCurrent, MacdPrevious, SignalCurrent;
double SignalPrevious;
int cnt, ticket, total;

MacdCurrent=iMACD(NULL,0,MACD_FastEMA,MACD_SlowEMA,MACD_SMA,PRICE_CLOSE,MODE_MAIN,0);
MacdPrevious=iMACD(NULL,0,MACD_FastEMA,MACD_SlowEMA,MACD_SMA,PRICE_CLOSE,MODE_MAIN,1);
SignalCurrent=iMACD(NULL,0,MACD_FastEMA,MACD_SlowEMA,MACD_SMA,PRICE_CLOSE,MODE_SIGNAL,0);
SignalPrevious=iMACD(NULL,0,MACD_FastEMA,MACD_SlowEMA,MACD_SMA,PRICE_CLOSE,MODE_SIGNAL,1);

total=OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderType()<=OP_SELL && OrderSymbol()==Symbol()) // check for symbol
{
if(OrderType()==OP_BUY) // long position is opened
{
if((*>0 && *<=* && *>* ) || (*<=0 && *>0))
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position
tek_mode=1;
return(0); // exit
}

}
else // go to short position
{
if((Macd*<0 && Macd*>=* && *<* ) || (*>=0 && *<0))
{
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close position
tek_mode=-1;
return(0); // exit
}
}
}
}
}
//+------------------------------------------------------------------+

where tek_mode=-1; is used to cut the instant replay value. || and && allow to use two groups of conditions as a single one.

 

Can you give me a hint?

How to get the ticks from MT4 to Matlab from my own DLL intelligently and as rationally as possible?

Has anyone probably done such a thing.

From MT in general terms:

start()

{

fMyDll(Bid); // pass bid into function from my dll with each new tick

}

what's next? what's the exchange method?

 
When testing strategies, is there a limit to the number of parameter combinations? That is, the number of passes of the tester.
 
Reworked the VSIindicator. It's a bit underdeveloped. Can anyone tell me where the error is?
Files:
vsi_twin.mq4  4 kb
 
nikost писал(а) >>
Reworked the VSI indicator. It's a little underdeveloped. Can anyone tell me where the error is?
Files:
Reason: