[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 947
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
Folks, please advise, I am having trouble implementing TrailingStop.... (trying to write an EA)
I am using an Alpari MT4 platform with Trailing Stop function (i.e. I can put a Trailing Stop 18 pips). Question for clarification, is it possible to use the platform functionality when opening an order (e.g. programmatically put a TrailingStop tick)?
It seems to work, but for some reason it opens two opposite positions.
So you're confused about something - these are clippings from my "avalanche" code - for you with minor changes. Everything works fine for me. Look additionally at this (similar snippet) here - everything works fine, look for your error, it's fine... This is the basic version of Avalanche - it's all detailed here - for yourself (as you need it) I'm sure special
It wouldn't be difficult to redo, there's a similar fragment...
The logic is as simple as 2x2:
1. First you determine that the previous pose is closed on the foot.
2. Then you check the absence of already open opposite position
And then, after you have determined it is not there yet - you open it (the opposite position that closed on stop).
There is a small omission here. When the opposite position opens, and then closes at stop or take, the conditions for opening will appear again. And I need ONE time.
Am I getting the data right? I'm asking because it's not working. There are no errors during compilation. That's why I think there is something wrong with the logic. Check it.
The picture shows only two bars although there are more.
FX Fish indicator. I need buy signals - on the first bar the histogram is higher than the buy level and the histogram on the first bar is higher than the second one.
on sell - on the first bar, the histogram is lower than the sell level and the histogram on the first bar is lower than the histogram on the second bar
I wrote the code like this
So you're confused about something - these are clippings from my "avalanche" code - to you with minor modifications. It all works fine for me. Look additionally at this (similar snippet) here - everything works fine, look for your error, everything is fine... This is the basic version of Avalanche - here everything is detailed - for yourself (as you need) I'm sure, a special
difficult to remake, such a fragment is present...
Here's what I got. I removed:
1.lots = NormalizeLots(lots); put a fixed 0.1
2.I fixed if (lastType == OP_SELL) OrderSend(Symbol(), OP_BUY, lots,...); since I'm testing longs first.
That's all.
There is a slight omission here. When the opposite pose opens and then closes at stop or take, the conditions for opening will arise again. And I need ONE time.
Write down the normal opening conditions, what ONE time means - per day, per second, in general in trades...
Formulate NORMAL opening conditions and write, for example - enter a time limit, let's say if one order has already been opened within a day, then subsequent orders will not open - this is trading once a day - the time limit for the EA - already posted in this thread, use the search, for example formulate the code below in the opening condition, i.e. if in this time range was already trading, then subsequent orders will not open, etc... Formulate specifically what you need, not incomprehensible as "ONE time", which once is once in a lifetime? Formulate normal trading terms, not fuck your brains out. Not to mention the website - this thread already has it all...
Write down the normal opening conditions, what ONE time means - per day, per second, in general in trades...
Formulate NORMAL opening conditions and write, for example - enter a time limit, let's say if one order has already been opened within a day, then subsequent orders will not open - this is trading once a day - the time limit for the EA - already posted in this thread, use the search, for example formulate the code below in the opening condition, i.e. if in this time range was already trading, then subsequent orders will not open, etc... Formulate specifically what you need, not incomprehensible as "ONE time", which once is one time in a lifetime? Formulate normal trading terms, not fuck your brains out. Not to mention the website - this thread already has it all...
001:
Trying to implement a simple flip. When a stop position is reached --> open the opposite position. I can't get it to open opposite position once and not open anything else. Please advise.
When a position reaches a stop . There is a position, it has a stop. When the price reaches the stop, open the opposite position. Do not open anything else on the first position.
The website https://www.mql5.com/go?link=http://www.kimiv.ru// has a function which defines exactly how an order is to be closed by a stop loss. I.e., when you connect this function, you should prescribe the condition if the position is closed after reaching the stop loss, if it is, you should open the opposite position and add the condition of its single opening into the condition of your basic position...