[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 62

 
Locker:

sergeev, you say that the codebase has an EA for my query. Only I haven't found a suitable one there and at the same time the search doesn't work.

Could you provide me with a link to my request!

I will be glad if you do!

I'll repeat the message: "I want two pending buy and sell orders +/- 15 pips from the current price with Take Profit of 15 pips, and the most important is that when one of them triggers and executes, the second pending order is deleted!

the forum search is as good as ever. here's a google search

To open two Buy and Sell orders at the same time. http://www.fx4u.ru/rinki-forex-commodities-cfd-futures-f14/yazik-programmirovaniya-mql4-opisanie-mts-skrip-f16/skript-otkritiya-orderov-t10800.html

the only thing left to do is to remove the pause when one of the pending pending pending orders triggers.

 
dzhini:

Question: do you want to learn how to program or do you just want the bot to be fixed? If the former, you need to understand why the execution of the order is happening. If the second, you should have said so right away...

As for your code, it takes data from the same buffer (of which there are 5) on the previous and pre-opening candlesticks, and waits for these conditions: (cci1<0 && cci>0) or (cci1>0 && cci<0) .... and I think it will wait forever.

Of course it will! Exactly when certain conditions are met. If the conditions are changed to (cci1<cci) or (cci1>cci) without changing anything else, the orders are executed (albeit perhaps in a messy way)!!! Here I can't figure out what the problem is. If it's not a problem for you, please explain, preferably with a concrete example. Preferably by email, that would not litter the forum.

Thanks in advance!

 

Sorry, I've got mine too. Here, I just gushed the code and it doesn't work.

//+------------------------------------------------------------------+
//| order type.mq4 |
//| Copyright © 2011, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
double New_Time=0,razniza, r;int i=0,h=0,q=0,w=0,s=0,g=0;
int start()
{int M,Y;
//----
double ticket,Lots=0.2,fractal_u=Ask,TakeProfit=50,Points = MarketInfo (Symbol(), MODE_POINT);
//----
if (i<10)
{
ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,fractal_u+5*Points,3,0,fractal_u+5*Points+TakeProfit*Points,
"open a position",163899,0,Red);if (New_Time==0){ New_Time = Time[0];} Alert("New_Time",New_Time);i++; }
Alert("OrderTypeOP_BUYSTOP",OrderType());OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES );
OrderClose( ticket,Lots,Bid,5, 0 );



if (h<10)
{
ticket=OrderSend(Symbol(),OP_SELLSTOP,Lots,fractal_u-5*Points,3,0,fractal_u-5*Points+TakeProfit*Points,
"open a position",163899,0,Red);if (New_Time==0){ New_Time = Time[0];} Alert("New_Time",New_Time);h++; }
Alert("OrderTypeOP_SELLSTOP",OrderType());OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES );
OrderClose( ticket,Lots,Ask,5, 0 );

if (q<10)
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Bid,3,0,5*Points+TakeProfit*Points,
"open a position",163899,0,Red);if (New_Time==0){ New_Time = Time[0];} Alert("New_Time",New_Time); q++; }
Alert("OrderTypeOP_BUY",OrderType());OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES );
OrderClose( ticket,Lots,Bid,5, 0 );

if (w<10)
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Ask,3,0,5*Points+TakeProfit*Points,
"open a position",163899,0,Red);if (New_Time==0){ New_Time = Time[0];} Alert("New_Time",New_Time);w++; }
Alert("OrderTypeOP_SELL",OrderType());OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES );
OrderClose( ticket,Lots,Ask,5, 0 );

if (s<10)
{
ticket=OrderSend(Symbol(),OP_BUYLIMIT,Lots,fractal_u-5*Points,3,0,fractal_u-5*Points+TakeProfit*Points,
"open a position",163899,0,Red);if (New_Time==0){ New_Time = Time[0];} Alert("New_Time",New_Time); s++; }
Alert("OrderTypeOP_BUYLIMIT",OrderType());OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES );
OrderClose( ticket,Lots,Ask,5, 0 );

if (g<10)
{
ticket=OrderSend(Symbol(),OP_SELLLIMIT,Lots,fractal_u+5*Points,3,0,fractal_u+5*Points+TakeProfit*Points,
"open a position",163899,0,Red);if (New_Time==0){ New_Time = Time[0];} Alert("New_Time",New_Time);g++; }
Alert ("OrderTypeOP_SELLLIMIT",OrderType());OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES );
OrderClose( ticket, Lots, Bid, 5, 0 );






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

I made it pretty fast, I set it up with the purpose to get a numeric value of the order type, it opens and closes all orders in a row, I mean all types. I checked OrderClose with the instruction, the parameters seem to be prescribed reasonably, correctly and in their places. What the hell else does he need?????

 
Dimka-novitsek:

Sorry, I'm with mine too. Here, I just blurted out the code, and it's not working.


Probably too fast, and should have learned it a bit. :-)

Then you would know that you buy at the ask and sell at the bid. And when they sell, the tokens should be lower than the purchase price.

 
Sorry to the GURU, but I will still return to my question about the channel indicator (simultaneously displaying them on 3 TFs) that uses iBars,iHigh,iLow and using it in the tester. I still haven't found the answer, but it continues to be very relevant to me. Can you tell me in what direction to dig to find it? Or maybe you should immediately turn to developers? They have already asked similar questions and they seemed to offer possible solutions.
 
dzhini:
Sorry to the GURU, but I will still return to my question about the channel indicator (simultaneously displaying them on 3 TFs) that uses iBars,iHigh,iLow and using it in the tester. I still haven't found the answer, but it continues to be very relevant to me. Can you tell me in what direction to dig to find it? Or maybe you should immediately turn to developers? They have already asked similar questions and they seemed to offer possible solutions.
To avoid searching for your question - repeat it
 
dzhini:
Sorry to the GURU, but I will still return to my question about the channel indicator (simultaneously displaying them on 3 TFs) that uses iBars,iHigh,iLow and using it in the tester. I still haven't found the answer, but it continues to be very relevant to me. Can you tell me in what direction to dig to find it? Or maybe you should immediately turn to developers? They have already asked similar questions and they seemed to offer possible solutions.

Not every indicator can be viewed in the visualisation
 
abolk:
not to search for your question - repeat it
Hello.
Can you tell me how to tame the indicator to the tester, if iBars and iHigh and iLow are used in the loop . I've looked through the material on the forum, but haven't found an answer. iHigh and iLow could be adjusted based on the information available, but they are used in a loop and this makes it difficult for me to find one. Can you give me some direction of thought..... please....

The indicator uses three channels on different TFs. I want to use it on 15 min with a 60-240-1440 setting. When I throw it on the tester chart, however, it draws lines in rather unexpected directions instead of channels. I can only blame it on i, as I was fixing something similar at fibo levels and murray. But there were static objects, so it was easier to find a solution. In this case I can't cope with it.

- Probably the tester does not have enough history to render.

Tried it. I waited for 2 weeks and did not have enough patience. If there are 100 bars on the screen. 100 daily bars (one of the daily channels) - that is 3.5 months of waiting. Perhaps there is a more elegant solution?

Vinin : Not every indicator can be visualized

Yes, I agree. But I've seen some indicators that could be fixed with iBarShift. But the issue here was a little bit more complicated for me.

Files:
 

Hello! Could you please tell me the code for an EA, namely its running time to and from, in hours and minutes.... There must be several variables up to 10

for example:

do not trade:

1. 13:34-14:20

2. 19:11-20:01

3. 01:30-01:32

4. ....

5. и... etc.

Thanks in advance!

 
dzhini:
it only draws the last channel. and why is this indicator in the tester?