Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 625

 
Vinin:

You just have to think before you ask questions. Close and not close are completely different concepts.

The question was very simple how to make the test result the same at any timing, if it wasn't clear enough we'll try to be more detailed next time... Thank you!
 
benzovoz:


MaperiodM5ma_2 = 25 / Period(); Suppose we set it on H1, the result will be 25/60=0.41, in int it will be 0, as there is no such МА period, in this case we use the minimum possible one, i.e. 1. Actually it should work, I sometimes use such variants and the result of trade insignificantly differs from the "native" period.

I got it, thanks a lot and it helped me understand some things ... I have not changed the result yet but thanks anyway :)
 
laveosa:

I got it, thanks and it helped me a lot to understand some issues ... I have not changed the result yet but thanks anyway :)


It won't work for you as we haven't considered the bars of the indicator calculation, I use the zero bar so it works for me and for you the 1st and 2nd bars, you can't "convert" them when switching to a higher timeframe.

M5maBIG_1= iMA(ed, Period() , MaperiodAVTO ,0,MODE_EMA,PRICE_CLOSE,1);


 
benzovoz:


It won't work for you as we haven't considered the bars of the indicator calculation, I use zero bar so it works for me and for you the 1st and 2nd bars, you can't "convert" them when you switch to a higher timeframe.

M5maBIG_1= iMA(ed, Period() , MaperiodAVTO ,0,MODE_EMA,PRICE_CLOSE,1);



i got it.... I will try it now.

 
I have an indicator:
//+------------------------------------------------------------------+
//| T3MA_ALARM.mq4 |
//| Copyright © 2011, Martingeil |
//| fx.09@mail.ru |
//+------------------------------------------------------------------+
//исправленный Martingeil, теперь можно в тестере увидеть его стрелки.
#property copyright "Copyright © 2011, Martingeil"
#property link "fx.09@mail.ru"

//---- indicator settings
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- indicator parameters
extern int period = 4; //12
extern int shift = 0; //сдвиг по бару
//---- indicator buffers
double BufferUp[],BufferDn[];
int q,st=5;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(2);
//---- drawing settings
SetIndexStyle(0,DRAW_ARROW,2);
SetIndexArrow(0,233);
SetIndexStyle(1,DRAW_ARROW,2);
SetIndexArrow(1,234);

SetIndexBuffer(0,BufferUp);//стрелка синяя верх
SetIndexBuffer(1,BufferDn);//стрелка красная вниз
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("T3MA-ALARM ("+period+")");
//---- initialization done
if(Digits==3 || Digits==5) q=10;
st=st*q;
return(0);}

int deinit()
{
ObjectDelete("low");
ObjectDelete("high");
}
//+----------------------------------------------------------------------+
//| Moving Average of Oscillator |
//+----------------------------------------------------------------------+
int start()
{
//---- ArraySetAsSeries --------------------------------------------------
double Ma[500],MaOn[500];
double y0[500],y1[500],y2[500];
int i,limit=ArraySize(Ma);
ArraySetAsSeries(Ma,true);
//---- IndicatorCounted --------------------------------------------------
int counted_bars=IndicatorCounted();
int limit1=Bars-counted_bars;
if (limit1>1){limit1=Bars-period-1;}
//---- EMA ---------------------------------------------------------------
for(i=limit1; i>=0; i--) Ma[i] =iMA(NULL,0,period,0,MODE_EMA,PRICE_CLOSE,i);
for(i=limit1; i>=0; i--) MaOn[i]=iMAOnArray(Ma,limit,period,0,MODE_EMA,i);

for(i=limit1; i>=0; i--)
{
y0[i+shift]=MaOn[i+shift];
y1[i+1+shift]=MaOn[i+1+shift];
y2[i+2+shift]=MaOn[i+2+shift];

if(y0[i+shift]-y1[i+1+shift]<0 && y1[i+1+shift]-y2[i+2+shift]>0){BufferDn[i+1]=High[i+1]+st*Point;}//продажа
if(y0[i+shift]-y1[i+1+shift]>0 && y1[i+1+shift]-y2[i+2+shift]<0){BufferUp[i+1]=Low[i+1]-st*Point;}//покупка
//---- Signal Trend Up || Dn ---------------------------------------------
if(y0[i]-y1[i+1]>0) Comment ("\n SWAPLONG = ",MarketInfo(Symbol(),MODE_SWAPLONG),
" SWAPSHORT = ",MarketInfo(Symbol(),MODE_SWAPSHORT),"\n BUY TREND ",DoubleToStr(Close[i],Digits));

else if(y0[i]-y1[i+1]<0) Comment ("\n SWAPLONG = ",MarketInfo(Symbol(),MODE_SWAPLONG),
" SWAPSHORT = ",MarketInfo(Symbol(),MODE_SWAPSHORT),"\n SELL TREND ",DoubleToStr(Close[i],Digits));
}


//---- done
return(0);}
//+---------------------------------------------------------------------+




I want to make an EA which would enter a position when an arrow appears, what condition should be written in the EA?

And here is the EA itself:

//+------------------------------------------------------------------+
//| million.mq4 |
//| Словаков Максим |
//| www.rubrf.ru |
//+------------------------------------------------------------------+
#property copyright "Словаков Максим"
#property link "www.rubrf.ru"
#property version "1.00"
#property strict

extern int Risk = 1;//риск на зделку
extern int Magic = 123; //магическое число


int x;
int y;
int v;
int z;
//+------------------------------------------------------------------+
int start()
{
double strelka=iCustom(NULL,0,"strelka",10,0,1,0);
double ma = iMA(NULL,0,72,0,MODE_SMMA,PRICE_CLOSE,0);
double atr = iATR(NULL,0,72,0);
double lotBuy = ((Risk*AccountEquity())/(1*(Ask-(Ask-atr)))/10000000);
double lotSell = ((Risk*AccountEquity())/(-1*(Bid-(Bid+atr)))/10000000);
if(OrdersTotal()==0)
{
if(ma<Bid)
{
  if(какое здесь нужно условие написать?)
{
x=OrderSend(Symbol(),OP_BUY,lotBuy,Ask,3,Ask-atr,0,"www.rubrf.ru",Magic,0,Blue);
}
}
if(ma>Bid)
{
  if( какое здесь нужно условие написать? )
{
y=OrderSend(Symbol(),OP_SELL,lotSell,Bid,3,Bid+atr,0,"www.rubrf.ru",Magic,0,Red);
}
}
}


return(0);
}
//+------------------------------------------------------------------+


 

Is it possible to download charts for technical analysis, - indexes S & P 500 Futures Chart, TA 25 Chart, and the S & P 500 Chart if possible can prompt how to do this, maybe there is an explanation of how to download!

I can't find such a broker, can you advise a program for technical analysis, which allows me to download the indexes I'm interested in (can be in real time) or a broker.

Maybe there is an opportunity to download these indices MT-4 or MT-5. I'm just beginning to try to do technical analysis, I would very much like to hear expert advice on how to cope with my task.

I am very grateful in advance for your help.
 
igalx:

Is it possible to download charts for technical analysis, - indexes S & P 500 Futures Chart, TA 25 Chart, and S & P 500 Chart if possible can tell you how to do this, maybe there is an explanation of how to download!

I can't find such a broker, can you advise a program for technical analysis, which allows me to download the indexes I'm interested in (can be in real time) or a broker.

Maybe there is an opportunity to download these indices MT-4 or MT-5. I just started to try to do technical analysis,i would like to get expert advice on how to cope with my problem.

In advance I am grateful for your help.



You can, you just need to convert it to the right format, there are even brokers who have these tools. Alpari SIP has them.

 

Good day, everyone!

Need help, advice.

I can't pass string data to DLL. Or the variable type is wrong, or it's written in a wrong encoding.

DLL in Delphi:

library SaveFile;

{ Important note about DLL memory management: ShareMem must be the
  first unit in your library's USES clause AND your project' s (select
  Project-View Source) USES clause if your DLL exports any procedures or
  functions that pass strings as parameters or function results. This
  applies to all strings passed to and from your DLL--even those that
  are nested in records and classes. ShareMem is the interface unit to
  the BORLNDMM.DLL shared memory manager, which must be deployed along
  with your DLL. To avoid using BORLNDMM.DLL, pass string information
  using PChar or ShortString parameters. }

uses
  SysUtils,
  Classes,Dialogs;

{$R *.res}
function SaveFiles(Path: ShortString ;
Symbol: Shortstring;
Stroka: string ): integer; stdcall;

var outfile: TextFile;

begin
AssignFile(outfile, 'C:\Log.txt');

 try
   //Append(outfile);
   Rewrite(outfile);

   writeln(outfile, Stroka);
   CloseFile(outfile);
   Result:=0;
 except
   Result:=1;
 end;
   Result:=0;
 
end;

exports SaveFiles;
 
end.

Do not pay attention to Path and Simbol variables. Some unreadable nonsense is systematically written to the file.

I tried all Stroka(Pchar,String, ShortString, AnsiString) variable types and still something like "0 0 : 0 3 : 0 6 : : 1 . 3" tried switching encodings - still unreadable.

 

All sorted out.

Everything is written in UTF-8 ASCII with spaces automatically added after each "useful" character. And to transfer more than 26 characters (13 useful) is not possible. I will have to pass a few variables and then connect. Somehow...

 

Greetings all.

I have an EA. it puts out a network of orders in both directions. due to the fact that pending orders are subject to a pledge on eci accounts, the idea of pending needs to be implemented inside the program while maintaining profitability. the way i did it. i added to the order placing condition a condition of price proximity to the intended pending order and had a subroutine to delete pending orders from which the price went away. in fact the orders were skipping through about one and yield in the tester was dropping.

The 2nd issue - how to measure the price movement speed on ticks or per minute. I was saving the price value at the beginning of each minute and compared it with the previous one, but it didn't prove to be effective.

Throw me some bright ideas)

Reason: