[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 161
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
The following situation occurred: Strategy Tester does not close positions by TakeProfit. Trading is done on TF Day, I looked at smaller TF on loss-making trades - the price goes down/up more than the required level for TakeProfit triggering, but the trade is not closed and when the price reaches StopLoss, the loss is fixed. I have even tried visualization - the price just passes TakeProfit and that's it. And sometimes everything works, and sometimes things like that appear. Just yesterday everything was fine, but today I ran the tester and got a total loss of performance. I tried to reinstall the terminal - it didn't help. I am not sure if I am going to use another brokerage company.
It's all about the spread, it's increased for the weekend.
It's like this.
It's all about the spread, it's increased for the weekend.
It goes something like this.
Thank you! I'll wait for weekdays to check it out.
It's all about the spread, it's increased for the weekend.
It's like this.
You have to be such a moron - I looked at the spread for my instrument on broker's website and was amazed - 11 pips! Thanks again!
Please, advise how to specify the condition correctly. If there is an open BUY order, if it is at breakeven, then we set BUYSTOP:
static bool flag ;
if(NewBar())
flag = true;
for(i=0;i<total;i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol() && OrderMagicNumber()==123)
{
if(OrderType()==OP_BUY)
{
if(OrderStopLoss()>OrderOpenPrice())
{
if(Ask>m && frUP>0 && flag)
{
price = NormalizeDouble(frUP+(Ask-Bid)+30*Point,Digits);
takeprofit = NormalizeDouble(price+tp*Point,Digits);
ticket = OrderSend(Symbol(),OP_BUYSTOP,Lots,price,5,Bid-sl*Point,takeprofit, "Fractal",123,TimeCurrent()+72000,Blue);
if(ticket>0)
flag = false;
else
Print("Error ",GetLastError());
}
}
}
}
}
does not work!!!
Have you tried to put braces according to logic? Because so far there isn't any.
What is written implies that at least one position is open. Otherwise it won't open any new ones.
Have you tried to put braces according to logic? Because so far there is none.
What is written implies that at least one position is open. Otherwise no new ones will be opened
And how do you arrange them? I've written a little bit more code:
Then another question, a little off the subject. Why do they increase the spread on weekends? They do not trade anyway.
No, not over the weekend, I didn't write it correctly, the Spread stays in the terminal at the last quote that came in
So you close the terminal during the day, Friday. And you test it on weekend.
No, not over the weekend, I didn't write it correctly, the Spread stays in the terminal at the last quote that came in
So you close the terminal during the day, Friday. And you test it over the weekend.
Got it, thanks! It makes much more sense that way.
And how do I arrange them? I've added a little bit of code:
OK, a little bit of logic
The loop is executed regardless of the condition if(NewBar())