[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 69

 

I'm sitting here and can't quite figure out how to implement the algorithm.

Maybe someone can help.

1. find the beginning of the day (I did this)

2. Find the maximum of the day (I did that)

3. i need to figure out the bars that would follow the first fractal after the MA crossing from top to bottom after that maximum.


I am attaching the figure.


 
komposter >> :

Instead of iRSI it should be iCCI.

YEPRST...... it's completely out of sight..... thank you, we'll fix it

 
luka >> :

I'm sitting here and can't quite figure out how to implement the algorithm.

Maybe someone can help.

3. You need to calculate the bars that will follow the first fractal after crossing the MA from top to bottom after this maximum.

"calculate the bars that will follow..."

Write simply: "I want to know where the price will go after I turn on the computer..." :-)))))

 
mukata >> :

"calculate the bars that will follow..."

Write simply: "I want to know where the price will go after I turn on the computer..." :-)))))


you don't get it.

these bars are already on the chart. or let's say it's the current bar. And if it fits the conditions - it is the bar you are looking for.

That's first of all.

And secondly, why bother with the bullshit if you don't understand what we're talking about?

 
Skydiver >> :

You could try this

OrderSelect(1, SELECT_BY_POS)

if(OrderOpenTime()!=0)

{

///необходимая операция

}

But this is only an option if you only have 1 order!

So we just check if the order is pending?


The idea is this: along with the stop of an order, for example on buy, three pending orders are set

I want a condition that one of these 3 pending orders becomes a normal "working order"

 
luka >> :

you don't understand.

These bars are already on the chart. or let's say this is the current bar. And if it meets the conditions, it's the bar you're looking for.

That's first of all.

And secondly, why are you wasting your time if you don't understand what we're talking about?

"Calculate the bars which will follow the first fractal after the re... "It means that they will follow it, not that they "already exist on the chart"...

But if "And if it meets the conditions - it is the bar you are looking for" - that's another matter. Describe the "Conditions", someone will help.

I apologise for the flooding, it just slipped out.



 
mukata >> :

"calculate the bars that will follow the first fractal after the re... " If they follow, it means they will, not if they are "already on the chart"...

But if "And if it meets the conditions - it is the bar you're looking for" - that's another matter. Describe "Conditions", someone will help.

Sorry for the flood, it just slipped.



Oooh I wrote it exactly like that.

I'm not going to aim at finding I don't know what, not knowing where or how.

I'm interested in specific bars that already exist. And to be more exact - their shift.

By the way, I've already implemented it, it turns out it's not so hard :)

 
fima_ >> :

so we just check if the order is pending?


The idea is this: when you stop an order, for example on buy, three pending orders are set

i want a condition that one of these 3 pending orders becomes a normal "working order"

So you have 3 pending orders and if at least 1 has triggered then some condition is set?

if yes, then it is like this

for(int cnt=0;cnt<OrdersTotal();cnt++) // последовательно проверяем все ордера

{

OrderSelect(cnt, SELECT_BY_POS)
if(OrderOpenTime()!=0) ///время не равно 0 значит отложка сработала(или как писал Roger if(OrderType()<2) )
{
///необходимая операция
}
}

or do you have 1 open order + 3 pending orders?

then you may try it that way

//в глобальных переменных

int tick[3];

//в функции start

//cначало записываем номера тикетов отложек в переменные

for(int cnt=0;cnt<OrdersTotal();cnt++) // последовательно проверяем все ордера

{

OrderSelect(cnt, SELECT_BY_POS)
if(OrderOpenTime()!=0)

{

tick[cnt]=OrderTicket();

}

}

//а далее проверяем выполнился ли отложенный ордер


for(int cnt=0;cnt<OrdersTotal();cnt++)

{

OrderSelect(cnt, SELECT_BY_POS)
if(OrderOpenTime()!=0)

{

for(int cnt2=0;cnt2<3;cnt++)

if(tick[cnt]==OrderTicket())

{

//необходимое условие

}

}

Or use a specific Magic for all orders and if there is an open order with this Magic, you need to use it like this:

в глоб перем

int mag=12345;

в ф start

/// При открытии отложки укажите ему в качестве магика mag

///ну а далее идет поиск "бывшей" отложки по Magic

for(int cnt=0;cnt<OrdersTotal();cnt++)

{

OrderSelect(cnt, SELECT_BY_POS)
if(OrderOpenTime()!=0&&OrderMagic()==Mag)

{

///необходимая операция

}

}

i haven't checked the code for possible errors!

 
Which order does the OrderSelect(0,SELECT_BY_POS) function return? Which one was opened first? Orders cannot swap? (I do not use pending orders)
 
AndreyK писал(а) >>
Which order does the OrderSelect(0,SELECT_BY_POS) function return? Which one has been opened first? Can orders not be swapped? (I do not use pending orders)

Right, which one is the earliest. This is convenient if you know for sure that you can only have one order open in principle and you can avoid overshooting. Orders are not swapped, but shifted to the smallest one when the earlier one is closed.

Reason: