[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 208

 
ScioMe:

Restarted the terminal, checked if the colour of the arrows was indicated when modifying:

There is also a record in the "Results" about the order modification: modifyed.

But there are no arrows on the chart.


Arrows on the chart show the new open price level of a pending order when it is modified. Stop levels of market orders when they are modified are displayed with horizontal dashes without arrows.
 
Roman.:


Run in visual testing mode - if the order modification is successful there should be an arrow on the chart.

In the Results tab in the table in the third left column there should be an entry - modify - and then the columns order, volume, price...

Check again if this entry is in the Results tab and look closely at the chart - there should be a green arrow when the order is modify when the test is visualised.


That's what a connoisseur means! In visualization mode (at last!!!) it draws a green (! - how long I've been trying to achieve that!) arrow (at last!). Thank you! It writes everything in "Results", it's fine here.

Yes, in the visualization mode the arrow behaves somehow inconsistently, that is, it is not drawn in one place. at every tick it is erased and appears at another value. Stop Loss is in the same place when order is pending and is not drawn during modification. Please, Roman, advise how to draw the green modification arrows so that they are visible at the end of testing?

 

Good evening. Please, advise how to "force" the advisor to stop placing pending orders in both directions, if i already have 5 buy and 5 sell market orders open and as soon as at least one of the orders closes, the advisor continues to place pending orders in the same direction as closed, and so on through the cycle.

//----------------------------------------------------------------------- check for set stop orders

double StopOrderUp,StopOrderDn,price,MinBuyOrder=1000000000,MaxSellOrder,OldBuyOrder,OldSellOrder,OldBuyLot,OldSellLot;

int TicketUp,TicketDn;

TimeOllOpenBuy=0;TimeOllOpenSell=0;

double OOL_BUYSTOP,OOL_SELSTOP;

for (i=0; i<OrdersTotal(); i++)

{

if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

{ price = OrderOpenPrice();

if (Magic==OrderMagicNumber() && OrderSymbol()==Symbol())

{

if (OrderType()==OP_BUYSTOP ) {StopOrderUp = price; TicketUp=OrderTicket(); OOL_BUYSTOP=OrderLots();}

if (OrderType()==OP_SELLSTOP) {StopOrderDn = price; TicketDn=OrderTicket(); OOL_SELSTOP=OrderLots();}

if (OrderType()==OP_BUY )

{ TimeOllOpenBuy = TimeOllOpenBuy + TimeCurrent()-OrderOpenTime();

if (MinBuyOrder > price) MinBuyOrder = price;

OldBuyOrder=price;

OldBuyLot=OrderLots();

if (DrawInfo&&!IsTesting()){

NameLine="Bay order "+OrderTicket(); ObjectDelete(NameLine); ObjectDelete(NameLine+" з");

ObjectCreate(NameLine, OBJ_TREND, 0, OrderOpenTime(),price,Time[0],Bid);

ObjectSet(NameLine,OBJPROP_COLOR,LightSkyBlue);

ObjectCreate(NameLine+" h",OBJ_ARROW,0,Time[0],Bid,0,0,0);

ObjectSet(NameLine, OBJPROP_STYLE, STYLE_DOT);// Style

ObjectSet(NameLine, OBJPROP_RAY, false); // Beam

ObjectSet(NameLine+" h",OBJPROP_ARROWCODE,3);ObjectSet(NameLine+" h",OBJPROP_COLOR,WhiteColor);}

}

if (OrderType()==OP_SELL)

{ TimeOllOpenSell = TimeOllOpenSell + TimeCurrent()-OrderOpenTime();

if (MaxSellOrder < price) MaxSellOrder = price;

OldSellOrder=price;

OldSellLot=OrderLots();

if (DrawInfo&&!IsTesting()){

NameLine="Sell order "+OrderTicket(); ObjectDelete(NameLine); ObjectDelete(NameLine+" з");

ObjectCreate(NameLine, OBJ_TREND, 0, OrderOpenTime(),price,Time[0],Ask);

ObjectSet(NameLine,OBJPROP_COLOR,Pink);

ObjectCreate(NameLine+" h",OBJ_ARROW,0,Time[0],Ask,0,0,0,0);

ObjectSet(NameLine, OBJPROP_STYLE, STYLE_DOT);// Style

ObjectSet(NameLine, OBJPROP_RAY, false); // Beam

ObjectSet(NameLine+" h",OBJPROP_ARROWCODE,3);ObjectSet(NameLine+" h",OBJPROP_COLOR,WhiteColor);}

}

}

}

}

if (MinBuyOrder==1000000000 && MaxSellOrder==0 && OOL_BUYSTOP!=OOL_SELSTOP)//if the series is closed

{

DELETEORDERS();

}

 
ScioMe:


What a connoisseur that is! In visualisation mode (finally!!!) it draws a green (! - how long I've been wanting that!) arrow (finally!). Thank you! It writes everything in "Results", it's fine here.

Yes, in the visualization mode the arrow behaves somehow inconsistently, that is, it is not drawn in one place. At every tick it is erased and appears at another value. Stop Loss is in the same place when order is pending and is not drawn during modification. Please, Roman, advise how to draw the green modification arrows so that they are visible at the end of testing?


I am testing EAs by opening prices of a new bar (in the EA code, you need to specify control of new bar formation) - everything is normally tested and drawn there; all arrows, including the modification option, are fully displayed for all orders - when new ticks come, nothing is overwritten and the modification arrows are still visible after the test ends. Try, test, opt, work... :-)))
 
doon:

Hello again.

The thing is, I need to check if the order has run out using isCloseLastPosByStop().I can't use magik because it will run out sooner or later (2147483647), and I can't erase or modify it. Please advise how to implement this.
 
polsvv:

VPS servvak 400 rubles or 120 UAH. depending on what country and no problem!

I am only trading the bot for a little while... Recently I put the bot on a remote server, appreciated the difference with my home cam! And sleep well :)

To reply to my request was not regarded as an advertisement, would you mind dropping the coordinates of the VPS server in your personal account to consider this option? Thanks in advance!
 
coronel:

Here is a picture of the EA's performance in the tester this past week.

Optimization was done from November 1 to 30, 2010.

I do not use it on real account. Just one of the toys

What lot?
 
Could you please tell me in what language the Metatrader platform itself is written?
 
Hello,

I need a Moving Average indicator to signal when it is crossed by price. Searched here, there is something similar only.

Thanks in advance.
 
Are there situations where only one of the two loops (for and while) can be used, or are they always interchangeable and a matter of taste?
Reason: