
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
Or you can combine it with the keypad buttons ;)
So this is where I am wrong. In case we need to pull both SL and TP from the order opening line, we can't do that, because there is a problem of how to know what to pull. So we need to identify the type of action on a real chart as in the direction of the cursor, either using a keyboard key or creating a button to set the type of action. The first option is used on the real chart and is the best in my opinion.
Yes, it is clear. What I mean is this: if there is no stop, we can pull the line of the order itself and the stop will be set where we "pull" the line to. This is the case if we don't have takeout processing. And if we have processing of both stops and toes, but the order has neither, then if we draw the order line, what should we set? A take or a stop?
if there is no stop and take
For example for buy: if you pull up, then tap, if you pull down, then sl
if there is no stop and take
For example for buy: if you pull up, then tap, if you pull down, then sl
This is the way it is in the terminal. And to make the Buy stop move to the profit zone - that's what we are discussing.
I'm talking about making it like the terminal.
The way it is done in the terminal has already been explained. Now it's about how NOT to do it in the terminal.
I think I write in Russian.
This morning, with a clear head, I found a solution. In addition, I got rid of the extra loop in the modification function. I have made a modification function for two variants:
1) If SL and TP are not set for an order, click on the order and SL and TP will pop up at 50 points. If needed, drag and drop them where needed. If the order already has SL and TP, we drag them wherever we want.
2) A variant of how it is done on a real chart. If we do not have SL and TP, we drag them out of the order line, and then move them wherever we want.
The first variant:
The second option:
We should not forget to declare the global variables OnSL, OnTp and OnOrd. And also, in the Expert Advisor wherethe TicketModifyOrder is reset,add the resetting of these variables. And correct names of some variables and name of modification function in EA.
I am waiting for applause from the grateful public. Let's applaud and disperse gentlemen).
I've also thought of a 3rd option. This is for those who do not like to carry SL and TP. The algorithm for setting the SL and TP is as follows: you should click once on the order, thus select it (we define the ticket) and then click once at the chart point where you want to set the SL (usually it is a point beyond the local price minimum and maximum). At the same time, the SL will be set at the chosen point and the TP will be set at a point which is Kt times farther away from the order price than the SL is from the order price . Ktp is how many times SL is greater than SL and is defined in an external variable. Note that TicketModifyOrder and OnOrd are now reset not in the OnTick() body but in the function itself. The resetting of these variables in the OnTick() body should be removed. It would also be possible in this variant to make it possible to drag and drop SL and TP, but I'm too lazy to think about it. You can just switch to 1 variant, if you need. And switch in the form of a button.