Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 350
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
In the picture, I have marked with an arrow where the output should be. I don't understand what the problem is. We go in, remember the time,
Then exit when the time is longer than the entry with an offset by one period and the price is below the 3-day MA min.
The code is as follows:
What do you think?I mean it would be good to post screenshots where you can see the price and the timeframe. Maybe there is pipsing on M1 and the server just does not have time to process the order in time.
And instead of t=Time[0]; better use OrderOpenTime().
If it's not too secret, I mean it would be good to publish screenshots where you can see prices and timeframe. Maybe there is pipsing on M1 and the server just does not have time to process the order.
Use OrderOpenTime() instead of t=Time[0];.
Eureka! I understood why.
signal > 0.006 almost always, so t=Time[0]; is updated all the time and the trade does not close.
I put t=Time[0]; in the block where the fact of opening of a position is announced.
Hi all, how does the EA being tested behave against gaps? I.e. on the test it shows good profit, but on the demo it has been gapping everything for two days already :(.
Hi all!
I have made EA by crossing two EMAs, this is my first EA and i am afraid i made some silly mistakes, so i am asking the professionals to review the code and give me some advice if something is wrong.
This EA should trade on bitcoin exchange, the price may jump by 30% per day, so stoploss and takeprofit should be in percent of price.
I have tested it on demo account, it seems to work, but I am afraid to use it on real account, the minimum lot is about $ 7, and cent account has no broker.
I have not attached trailing stop yet, and I'm going to compare EMA difference not with zero, but with some small value, to avoid frequent trades when curves run parallel.
The program is mostly made up of bits and pieces plucked from examples and tutorials, so there's a concern that I might have messed up somewhere when putting it together.
Variables:
This function defines lot size:
We open an order here:
Here we close 1 or all orders
This function calculates the difference of two EMAs
And here is the body of the program
Dear Sirs hello all!!!
Help me make out the deals!!! There is a set with deals, I downloaded it from a site where there was a contest where the guy with $10000 for a month or a week I do not remember made $300 000! How can I tell where he closed the deal!!! Opening time, price, lot, currency pair all there!!!
.........................................................................................................................................................................................................................................
THERE ARE SO MANY TRADES, I DO NOT KNOW WHERE HE CLOSED THEM ALL!
Results are displayed as of 2013-08-29 14:02:05(EET)
TRANSACTION TIME TYPE LOTS SYMBOL PRICE SWAP PROFIT
272984 2013-08-05 07:58:50 SELL 1.00 EURAUD 1.49556 0 0
272986 2013-08-05 07:58:56 SELL 1.00 EURAUD 1.49553 0 0
272988 2013-08-05 07:59:03 SELL 1.00 EURAUD 1.49549 0 0
272999 2013-08-05 07:59:57 SELL 1.00 EURAUD 1.49534 0 0
273002 2013-08-05 08:00:02 SELL 1.00 EURAUD 1.4954 0 0
273004 2013-08-05 08:00:07 SELL 1.00 EURAUD 1.4954 0 0
284429 2013-08-05 16:47:27 BUY 1.00 EURAUD 1.48839 0 628.85
284432 2013-08-05 16:47:33 BUY 1.00 EURAUD 1.48838 0 629.71
284433 2013-08-05 16:47:37 BUY 1.00 EURAUD 1.48843 0 625.28
284435 2013-08-05 16:47:43 BUY 1.00 EURAUD 1.48857 0 612.81
284439 2013-08-05 16:47:47 BUY 1.00 EURAUD 1.48854 0 615.46
284442 2013-08-05 16:47:50 BUY 1.00 EURAUD 1.48859 0 611.01
284443 2013-08-05 16:47:51 BUY 1.00 EURAUD 1.48859 0 0
284447 2013-08-05 16:48:01 BUY 1.00 AUDUSD 0.89056 0 0
284449 2013-08-05 16:48:09 SELL 1.00 EURAUD 1.48735 0 -110.44
284451 2013-08-05 16:48:21 BUY 1.00 AUDUSD 0.89061 0 0
284454 2013-08-05 16:48:25 BUY 1.00 AUDUSD 0.8906 0 0
284458 2013-08-05 16:48:30 BUY 1.00 AUDUSD 0.89058 0 0
284461 2013-08-05 16:48:34 BUY 1.00 AUDUSD 0.89051 0 0
284465 2013-08-05 16:48:39 BUY 1.00 AUDUSD 0.89052 0 0
284469 2013-08-05 16:48:43 BUY 1.00 AUDUSD 0.89053 0 0
284472 2013-08-05 16:48:47 BUY 1.00 AUDUSD 0.89051 0 0
284475 2013-08-05 16:48:51 BUY 1.00 AUDUSD 0.89056 0 0
284479 2013-08-05 16:48:55 BUY 1.00 AUDUSD 0.89056 0 0
284483 2013-08-05 16:48:59 BUY 1.00 AUDUSD 0.89056 0 0
284487 2013-08-05 16:49:03 BUY 1.00 AUDUSD 0.89058 0 0
284491 2013-08-05 16:49:08 BUY 1.00 AUDUSD 0.89053 0 0
284492 2013-08-05 16:49:12 BUY 1.00 AUDUSD 0.89053 0 0
286130 2013-08-05 16:51:55 BUY STOP 1.00 AUDUSD 0.8915 0 0
288418 2013-08-05 16:52:05 BUY STOP 1.00 AUDUSD 0.89255 0 0
293964 2013-08-05 16:52:14 BUY STOP 1.00 AUDUSD 0.8935 0 0
299297 2013-08-05 16:52:26 BUY STOP 1.00 AUDUSD 0.89459 0 0
299482 2013-08-05 16:52:35 BUY STOP 1.00 AUDUSD 0.89553 0 0
299533 2013-08-05 16:52:53 BUY STOP 1.00 AUDUSD 0.89655 0 0
299595 2013-08-05 16:53:02 BUY STOP 1.00 AUDUSD 0.89703 0 0
300040 2013-08-05 16:53:36 BUY STOP 1.00 AUDUSD 0.89751 0 0
300096 2013-08-05 16:53:46 BUY STOP 1.00 AUDUSD 0.898 0 0
300151 2013-08-06 07:54:49 SELL 1.00 AUDUSD 0.89756 4.36 519.04
300153 2013-08-06 07:54:53 SELL 1.00 AUDUSD 0.89749 4.36 512.04
300154 2013-08-06 07:54:58 SELL 1.00 AUDUSD 0.89743 4.36 506.04
300156 2013-08-06 07:55:01 SELL 1.00 AUDUSD 0.89738 4.36 501.04
300158 2013-08-06 07:55:05 SELL 1.00 AUDUSD 0.89736 4.36 499.04
300160 2013-08-06 07:55:11 SELL 1.00 AUDUSD 0.89772 4.36 535.04
300161 2013-08-06 07:55:15 SELL 1.00 AUDUSD 0.89771 4.36 534.04
300163 2013-08-06 07:55:19 SELL 1.00 AUDUSD 0.89765 4.36 528.04
300167 2013-08-06 07:55:36 SELL 1.00 AUDUSD 0.89733 4.36 496.04
300169 2013-08-06 07:55:40 SELL 1.00 AUDUSD 0.89733 4.36 496.04
300171 2013-08-06 07:55:44 SELL 1.00 AUDUSD 0.89735 4.36 498.04
300173 2013-08-06 07:55:49 SELL 1.00 AUDUSD 0.89732 4.36 495.04
300178 2013-08-06 07:55:52 SELL 1.00 AUDUSD 0.89725 4.36 488.04
300181 2013-08-06 07:55:56 SELL 1.00 AUDUSD 0.89714 4.36 477.04
Dear Sirs hello all!!!
Help me make out the deals!!! There is a set with deals, I downloaded it from a site where there was a contest where the guy with $10000 for a month or a week I do not remember made $300 000! How can I tell where he closed the deal!!! Opening time, price, lot, currency pair all there!!!
.........................................................................................................................................................................................................................................
THERE ARE SO MANY TRADES, I DO NOT KNOW WHERE HE CLOSED THEM ALL!
There is no way, they do not specify closing price on purpose, there is no free())
I UNDERSTAND BUT THERE IS A LOT AND A PRICE AND A BUY OR SELL FOR EXAMPLE:
284429 2013-08-05 16:47:27 BUY 1.00 EURAUD 1.48839 0 628.85
THE PRICE IS 1.48839 CURRENCY PAIR -EURAUD, LOT 1 BROKER 5 MARK!!! PROFIT 628 I.E. THE PRICE WENT 628 PIPS UP!!! at lot 1!!! i mean if you can look at the history, i don't understand, honestly the time is almost 17:00 but the price is much lower than this 1.48839!!! EVEN IF THIS IS THE CLOSING PRICE I COUNTED 7000 PIPS I DO NOT UNDERSTAND HOW
I UNDERSTAND BUT THERE IS A LOT AND A PRICE AND A BUY OR SELL FOR EXAMPLE:
284429 2013-08-05 16:47:27 BUY 1.00 EURAUD 1.48839 0 628.85
THE PRICE IS 1.48839 CURRENCY PAIR -EURAUD, LOT 1 BROKER 5 MARK!!! PROFIT 628 I.E. THE PRICE WENT 628 PIPS UP!!! at lot 1!!! i mean if you can look at the history, i don't understand, honestly the time is almost 17:00 but the price is much lower than this 1.48839!!! EVEN IF IT'S THE CLOSING PRICE I COUNTED 7000 PIPS I DON'T UNDERSTAND HOW THAT'S POSSIBLE
Where did you count 7000 pips? It's the opening price, but even if it were the closing price, one price is not enough to count something there, you still need both of them. I think it's just a fake, unless the contest ran until December 18, when this position could have been closed with 630 pips profit. But before that he would have been forced to sit out a drawdown of about -830 pips (for 4zn), not very clever, the strategy is such a dismal guano...
I would have lost it on the real account, it works on a demo when I have a lot of virtual money)))
evillive, good afternoon, thank you for pointing me in the right direction!!!
r772ra, hello, thank you for explaining the error exhibiting the corrected code (I consider this the best way to learn (practice (-Do the theory, my friend, and the tree of life is evergreen.-))).
for (int i = 0; i<=OrdersTotal(); i++)
{
if (OrderSelect (i,SELECT_BY_POS,MODE_TRADES) == true)
{
if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magic && OrderProfit()>= NormalizeDouble (TP*Point,Digits))
{
if (OrderType() == OP_BUY)
double Lots = OrderLots();
double HalfLot = NormalizeDouble (Lots*0.5,2);
OrderClose(OrderTicket(),HalfLot,Bid,0,HotPink);
if (OrderType() == OP_SELL)
double Lots1 = OrderLots();
double HalfLot1 = NormalizeDouble (Lots*0.5,2);
OrderClose(OrderTicket(),HalfLot1,Ask,0,HotPink);
}
}
}
}
Oh, and how do I make this function work only once per open order?