[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 315

 
dekker:

Friends!

A global question has arisen

Is it possible to get the tick stream in the terminal on weekends, so that I could write and debug EAs quietly?

I've already got a few tips on how to use it in my trading robot.

i can't use one tick triggering the EA, i need a flow of ticks in a certain range

is there such a thing in nature?

mt4 servers that emulate streaming quotes on weekends ?

there are brokers working on weekends, google it
 
dekker:

Friends!

A global question has arisen

Is it possible to get the tick stream in the terminal on weekends, so that I could write and debug EAs quietly?

I've already got a few tips on how to use it in my trading robot.

i can't use one tick triggering the EA, i need a flow of ticks in a certain range

is there such a thing in nature?

mt4 servers that emulate streaming quotes on weekends ?

Hang a script -
#import "user32.dll"
   int PostMessageA(int hWnd, int Msg, int wParam, string lParam);
   int RegisterWindowMessageA(string lpString);
#import

int start(){
   bool asd;
   while(!IsStopped()){
      PostMessageA (WindowHandle (Symbol(), Period()), WM_COMMAND, 33324, 0);
      PostMessageA (WindowHandle (Symbol(), 0), RegisterWindowMessageA ("MetaTrader4_Internal_Message"), 2, 1);
      Sleep(5000);
      if(asd){Comment("A");asd=false;}else{Comment("V");asd=true;}
   }
   return(0);
}
tick emulation. I don't know if that's what you need or not. There is also a timer, either with kernel32 or user32, look it up on the forum.
 

Hello everyone, please help a newcomer.

The question is as follows ... for example I have an indicator and it is drawn in the #property indicator_separate_window, the indicator has two "buffers", it turns out two lines ... my question is how to make an arrow or line in the MAIN window (not the indicator window, but the price chart window) when the lines cross ...?

For example take a regular RSI, how to make a line crossing with zero to display arrows on the price chart ...

 
clubsmi:

Hello everyone, please help a newcomer.

The question is as follows ... for example I have an indicator and it is drawn in the #property indicator_separate_window, the indicator has two "buffers", it turns out two lines ... my question is how to make an arrow or line in the MAIN window (not the indicator window, but the price chart window) when the lines cross ...?

For example take a regular RSI, how to make the line crossing zero to display arrows on the price chart ...


Other indicator on#property indicator_chart_window via iCustom, and there on DRAW_ARROW.
 

I can't understand the expression:

if (counted_bars==0 && downloadhistory)

if number of bars counted =0 anddownloadhistory?downloadhistory is a global logical variable initiallyfalse. What condition does it carry? I would understand if the condition is this

if (counted_bars==0 && downloadhistory == false)

Explain to a beginner, please!

 
dekker:

Friends!

A global question has arisen

Is it possible to get the tick stream in the terminal on weekends, so that I could write and debug EAs quietly?

I've already got a few tips on how to use it in my trading robot.

i can't use one tick triggering the EA, i need a flow of ticks in a certain range

is there such a thing in nature?

mt4 server that emulates a stream of quotes on weekends ?

Library.

Section"4.7 Functions to control chart updates".

 

One more thing:)

There is a ZigZag in the MT4 application in the custom indicators. It has parameters:

//---- indicator parameters
extern int ExtDepth=12;
extern int ExtDeviation=5;
extern int ExtBackstep=3;

What do they stand for?

 

Vadim, it's not working. Since it's the weekend, I'm studying reading-writing on my own. I am writing two scripts for checking: I put one of them on a seconds timeframe and it generates an array element by element. The second one I send to any pair and it prints this array. So, scripts:

Seconds:

#import "SharedMemoryMT4.dll"
        bool MemoryWriteInt(int nArea, string sPrefixArea, int nIndex, string sName, int nStartByte, int nValue);
        int MemoryCreateProjection(int nArea, string sPrefixArea, int hFileUser, int nIndex, string sName, int nSize);
        bool MemoryResize(int nArea, string sPrefixArea, int nIndex, string sName, int nSize);
#import
int Σ, Δt, j;
int start(){
   GlobalVariableSet("nAddress", MemoryCreateProjection(1, "", NULL, -1, "ind", 4));
   for(int i=1; i>Bars; i++){
      Δt=Time[i-1]-Time[i];
      Σ=Σ+Δt;
      MemoryResize(1, "", -1, "ind", 4*Σ);//=ArrayResize(ind, Σ);
      for(; j<Σ; j++) MemoryWriteInt(1, "", -1, "ind", j*4, i);
   }
   /*
   Δt[0]=1 => addr(j*4)=0*4=0, var(i)=0x0001.//out: {0x0001}
   Δt[0]=2 => addr(j*4)=0*4=0, var(i)=0x0001,
              addr(j*4)=1*4=4, var(i)=0x0001.//out: {0x0001, 0x0001}
   Δt[0]=1, Δt[1]=2 => addr(j*4)=1*4=4, var(i)=0x0002,
                       addr(j*4)=2*4=8, var(i)=0x0002.//out: {0x0001, 0x0002, 0x0002}
   Δt[0]=2, Δt[1]=2 => addr(j*4)=2*4=8, var(i)=0x0002,
                       addr(j*4)=3*4=12, var(i)=0x0002.//out: {0x0001, 0x0001, 0x0002, 0x0002}
   */
   return(0);
  }

The second script, which prints the array, hangs on any pair already formed:

#import "SharedMemoryMT4.dll"
        int MemoryReadInt(int nArea, string sPrefixArea, int nIndex, string sName, int nStartByte);
        bool MemoryUnProjection(int nArea, string sPrefixArea, int nIndex, string sName, int pcAddress);
        int MemorySize(int nArea, string sPrefixArea, int nIndex, string sName);
#import

int start(){
   for(int i=0; i<MemorySize(1, "", -1, "ind"); i=i+4) Print(MemoryReadInt(1, "", -1, "ind", 4*i));
   MemoryUnProjection(1, "", -1, "ind", GlobalVariableGet("nAddress"));
   return(0);
  }

To be fair, I put

{MemoryWriteInt(1, "", -1, "ind", j*4, i); Print(j, " - ", i);}

the second for. Looking at the log. At least some values are written at addresses, or rather offsets relative to nAddress: 0-3FF, 7FF-83FF, BFFF-C3FF. For all other ranges - critical error inMemoryWriteInt. I attach history file with seconds candlesticks.

Files:
sec_eurusd1.zip  18 kb
 
gyfto:

Vadim, it's not working. Since it's the weekend, I'm studying reading-writing on my own. I am writing two scripts for checking: I put one of them on a seconds timeframe and it generates an array element by element. The second one I send to any pair and it prints this array. So, scripts:

Seconds:

The second script, which prints the array, hangs on any pair already formed:

To be fair, I put

the second for. Looking at the log. At least some values are written at addresses, or rather offsets relative to nAddress: 0-3FF, 7FF-83FF, BFFF-C3FF. For all other ranges - critical error inMemoryWriteInt. I attach history file with seconds candlesticks.

Is the test script from the kit working?

You don't need to change the allocated memory size so often. This is a brake. The memory is allocated discretely by 4Kb. Rounded up. This is a mapping feature.

Make a simple test project so that you could check it. What you are publishing is impossible to check. There are too many syntax errors.

 
GaNDarM:

I can't understand the expression:

if number of bars counted =0 anddownloadhistory?downloadhistory is a global logical variable initiallyfalse. What condition does it carry? I would understand if the condition is this

if (counted_bars==0 && downloadhistory == false)

Please explain to a beginner!


Let me try it now. When we write

bool bVar=true;
if(bVar) какие-то_действия
//------------------
bool bVar=false;
if(!bVar) какие-то_действия
//------------------
if(true) какие-то_действия

then in all cases these actions will always be performed, because the first two are similar to the third (check, simplify the expression). That is, if they are boolean variables, we don't need to put ==true, ==false, because they are already true or false by themselves.