[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 515
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
Please advise how to buy a trading robot ?
Hello,
Please have this question about the EA:
I have an order opening by swinging, for example, if MA_1 > MA_2 then we buy. But when I exit the trade this rule is triggered again.
How can I tell the EA to open a position only if the price has moved no more than 4 bars away from MA_2?
Thank you!
If something is wrong or wrong place, do not kick me. This is my first post on this huge forum.
Hello,
Please have this question about the EA:
I have an order opening by swinging, for example, if MA_1 > MA_2 then we buy. But when I exit the trade this rule is triggered again.
How can I tell the EA to open a position only if the price has moved no more than 4 bars away from MA_2?
Thank you!
If something is wrong or wrong place, do not kick me. This is my first post on this huge forum.
Thanks, I'm just at that level of knowledge. There's the same problem with the script in the example. It's inconvenient when you turn on the script and it goes in at the end of the trend.
How do I tell the script to trigger only if there are less than 4 bars after the crossing of two bars?
Thanks, I'm just at that level of knowledge. There's the same problem with the script in the example. It's inconvenient when you turn on the script and it goes in at the end of the trend.
How do I tell the script to trigger only if there are less than 4 bars after the crossing of two bars?
People, I've already asked here how to make an order open only when a new candle appears. I am using a D1 timeframe.
I have decided to place pending orders at certain levels (buystop_lvl and sellstop_lvl), based on analysis of previous candlesticks.
I wanted to place them at the beginning of the day and delete them when a new candlestick comes. It doesn't matter if the pending orders were activated or not, if they were activated, then market orders should also be closed. At most 2 orders, buystop and sellstop.
Here is what I wrote:
1. First I check whether the market orders or pending orders are active, and if they are, I delete/close them.
2. Then I place pending orders by calculated levels:
3. If I have a Sell or Sell Sell order, I will open a new bar on it:
As a result, when a new candle opens, the orders are placed and immediately deleted. The orders are placed and immediately deleted.
When I commented out the code from point (1) I couldn't get it to open orders in the tester, but the orders didn't open, i.e. the orders didn't become market ones.
Can you tell me what might be the problem?
This NewBar() function cannot be used twice in a row
Something like this is better:
bool newBar = NewBar();
// and further in the text, replacing NewBar() with newBar