[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 113
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Cycle through the positions
Cycle through the positions
Tried it, didn't work. So yes, I can find it. But the problem is that I get the following situation:
For example, on 01.01 I opened a position, but the condition triggered only on 02.01. I.e., from the opening price of the order in the negative side, the price has passed 50 pips on the second day. If the condition is fulfilled, the action will be executed. And the action is to reduce the trade by 1/3. i.e. to reduce the volume of the trade by a factor of three. But the action will work until the lot is closed completely. We can set some flag. If b=0, then the action is in place. And at the end of the action b=1. If we do not null the flag at the end of the day, the trade will be executed once and that's it when we test it by history. If we zero the flag, then as soon as the flag is zeroed, the action will again start reducing orders until it closes it completely. I thought it would be possible to compare the volume of initially opened trade and then changed volume, but they will always be the same when comparing. If we decrease the volume of lot, the volume of funds in the account will also decrease, hence the initial volume will be recalculated. I.e. it is also not that, I think for the 3rd day. I have no clue, do you have any other ideas?
Good afternoon!
Dear Professionals, could you please advise me.
If the price exceeds by 50 pips the open price of this order, the order has to be modified.
OrderSelect(0, SELECT_BY_POS,MODE_TRADES);
double OPEN = OrderOpenPrice();
double maximus = OPEN + 0.00500;
Alert ("maximus = ",maximus);
double minimus = OPEN - 0.00500;
RefreshRates();//Refresh data.
timecur = TimeToStr(TimeCurrent(),TIME_SECONDS); //Calculate current time in HH:MM format.
if ((timecur > "00:00:00") && (timecur < "22:58:00") && (Deal_s == 1) && (Deal_bb == 0)&& (Bid > maximus))
{
OrderSelect(0, SELECT_BY_POS,MODE_TRADES);
Lootup = OrderLots () * 0.34;
Lootdown = OrderLots () * 0.34;
OrderClose(OrderTicket(), Lootdown, Ask, 10, CLR_NONE);
Alert (GetLastError());
Deal_bb = 1;
}
If it happens during the day, I am able to do it. Please advise, how to check if opening price + 50 P is controlled by price for each lot, until it closes in few days?
You time a string and then measure by strings - original!!!!
You don't need to invent anything: first you check the time resolution and then just trailing orders. Proven solutions for both can be found here and here.
Tried it, didn't work. It does work, but the problem is: I can't find it. But the problem is that I get the following situation:
For example, 01.01 I opened a deal, but the condition triggered only 02.01. I.e. from the opening price of the warrant in the negative side of the price passed 50 ppm on the second day. If the condition is fulfilled, the action will be executed. And the action is to reduce the trade by 1/3. i.e. to reduce the volume of the trade by a factor of three. But the action will work until the lot is closed completely. We can set some flag. If b=0, then there is an action. And at the end of the action b=1. If we do not null the flag at the end of the day, the trade will be executed once and that's it when we test it by history. If we zero the flag, then as soon as the flag is zeroed, the action will again start reducing orders until it closes it completely. I thought it would be possible to compare the volume of initially opened trade and then changed volume, but they will always be the same when comparing. If we decrease the volume of lot, the volume of funds in the account will also decrease, hence the initial volume will be recalculated. I.e. it is also not that, I think for the 3rd day. I have no clue, do you have any other ideas?
What do days have to do with it? You just write down what you want, and you'll be advised of the algorithm. It seems to me that you should not check the days but check the profit/loss of the order and then take your pick from it. 50 (or whatever) pips are important for you...
You put time in a string, and then measure it with strings - that's original!
You don't have to invent anything: first you check the time resolution, and then you simply trailing the orders. Proven solutions for both can be found here and here.
Thank you so much for your reply, you gave me a link to exactly what I need. I will try it now, but I think it will work.
I'm sorry about the bugs, but I'm new to programming and not very good at it yet.
What do days have to do with anything? You just write down what you want and they will tell you the algorithm. It seems to me that you should not check days but check profit/loss of an order and depend on it, because 50 (or whatever) points are important for you...
Yes, you are right. My profit/loss is what I am relying on. TarasBY pointed out exactly what I needed. I'll look into it now.
Thanks for your kind attention!
Can you please tell me if there is a kim function to search for fractals?
How do I write the same function that counts the number of fractals in a given period?Can you tell me if there is a kim function for finding fractals?
How to write the same function that counts the number of fractals in a given period?It goes something like this:
The extrema of the ZigZag from the current time to Time_Control are collected in an array.
Can you please suggest a function to check the new fractal or the old one?
Here, I went to the topic "Useful functions" and brought you "on a silver platter:
Live and use it in good health! There are all kinds of them! You don't have to ask, you don't have to wait, you just take it and use it!