MQL4 - automated forex trading   /  

Forum

Bar Question

Back to topics list To post a new topic, please log in or register

avatar
80
Yellowbeard 2010.07.21 22:16 

Is there a way to place an arrow at the previous bar before the current?

This will place an arrow at the currnet bar;

ObjectDelete("MdSymbolAi");
ObjectCreate("MdSymbolAi", OBJ_ARROW, 0, Time[0],vL);

ObjectSet("MdSymbolAi", OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
ObjectSet("MdSymbolAi", OBJPROP_COLOR,Lime);

This will place an arrow at the maximum and minimum values for the Open of the previous 5 bars;

{
CntBars = 5;

int lowshift=iLowest(NULL,0,MODE_OPEN,CntBars,0);
double Minimum=Open[lowshift];
datetime lowtime=Time[lowshift];

int maxshift=iHighest(NULL,0,MODE_OPEN,CntBars,0);
double Maximum=Open[maxshift];

datetime maxtime=Time[maxshift];

for(i=0;i<CntBars-1;i++)

{

if (Low[i]< Minimum)
{Minimum=Low[i]; n = i;



ObjectCreate("UpSymbolAb", OBJ_ARROW, 0, lowtime,Minimum);
ObjectSet("UpSymbolAb", OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
ObjectSet("UpSymbolAb", OBJPROP_COLOR,White);

}

if (High[i]> Maximum)
{Maximum=High[i];

ObjectCreate("DnSymbolAb", OBJ_ARROW, 0, maxtime,Maximum);

ObjectSet("DnSymbolAb", OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);
ObjectSet("DnSymbolAb", OBJPROP_COLOR,White);

}

I simply want to place an arrow at the previous bar, from the current bar.

Thanks!

MT4TerminalSync - System for the Synchronization of MetaTrader 4 Terminals

MT4TerminalSync - System for the Synchronization of MetaTrader 4 Terminals

This article is devoted to the topic "Widening possibilities of MQL4 programs by using functions of operating systems and other means of program development". The article describes an example of a program system that implements the task of the synchronization of several terminal copies based on a single source template.


avatar
2646
phy 2010.07.21 22:27 

ObjectCreate("MdSymbolAi", OBJ_ARROW, 0, Time[1],vL);


avatar
80
Yellowbeard 2010.07.21 23:12 
phy:

ObjectCreate("MdSymbolAi", OBJ_ARROW, 0, Time[1],vL);


Thanks, Phy!

That did the trick!

Back to topics list  

To add comments, please log in or register