There is an interesting trading idea. Help me find errors in the code (mql4). - page 13

 
Sergey Gritsay:
I'll add the overall profit
added
Files:
InfoProfit.mq4  34 kb
InfoProfit.mq5  34 kb
 
Y - this stock market is capricious, I don't know about the real one, but on the demo my Expert Advisor set a stop loss below the Take Profit for a sell position. I made checks so that such situations would not arise.
Files:
 

Today's forex results

Stock market

 
Sergey Gritsay:
Added
Thanks... great job... Looks like it gives out total profits of the whole history, and it should only give out profit for today or, even better, for the last 6 hours - it gives out profit after which it only spends plus trades and closes minus ones, say, after 3 hours of work - you made good profit, but not so much for hours, you won't lose... When I tried to use Mt4, I tried to buy a brokerage firm, but in MT5 I don't know if I can close the profit with another brokerage firm. I don't know how to do it with a fund, I don't know how to do it with forex, they say MT5 is too raw for it against Quick...
 
Сергей Криушин:
Thanks... great job... Looks like it gives out total profits of the entire history, and it should only be for today or even better for the last 6 hours - it gives out all last trades, after that it only spends profits and closes negative ones, say after 3 hours of work - you made good profit, but not so much for hours... When I tried to use Mt4, I tried to buy a brokerage firm, but in MT5 I don't know if I can close the profit with another brokerage firm. I have no idea how to use it with a fund, I have no idea how to use it with forex, they say MT5 is too raw for it against QuickBooks...
I don't know, I set this Quick, opened it and got lost, I couldn't make a single deal even on demo, while in MT5 everything is intuitive. As for the deal analyser, I just sketched out a simple one. If you make a complicated one and link it with an EA, it might take more than a month.
 
added in the settings from which date to which date we give the result
Files:
InfoProfit.mq4  35 kb
InfoProfit.mq5  34 kb
 

Greetings to the fair company of fiction makers)! After a quick read of the thread, I think I'll join you in your fiction, ....

I wanted to dedicate a couple of stocks to the author for the stock market, ......

I'm not a very good programmer too" I just did it all on the spot, so let's download a couple of stock codes and put them into my EA :)

input int period_CCI_S=100;

input int period_CCI_F=13;

I will try this variant of the channel at the weekend

I miss the clearing output on the futures market in my EA (this is a must in my opinion) !

I can compensate for what I stole with my code stocks)

input string i_sTimeSettings="Trade Time Settings"; //

input bool i_bExitClearing1=true; // close position before clearing 1

input string i_sClearing1StartTime="13:00"; // start time of clearing 1

input string i_sClearing1EndTime="13:03"; // End time of clearing 1

input bool i_bExitClearing2=true; // Close position before clearing 2

input string i_sClearing2StartTime="18:45"; // Start time of clearing 2

input string i_sClearing2EndTime="19:00"; // End time of clearing 2

input bool i_bExitEndSession=true; // Close position before end of session

input string i_sEndSessionTime="22:56"; // End Time

the idea lasts

 
Sergey Gritsay:
I came across similarvideo of the same author, only the trend indicator is different, I need to think it over.

I think to filter it with muvin,,,, but my teacher prescribed it with the wrong natation and I don't have to invent it and the function is prescribed

// Function to calculate the signal to buy (MA goes up).

bool BuySignal()

{

// Create an array of MA values, reverse its direction and fill it with the last three values of the moving average.

double fMA[];

ArraySetAsSeries(fMA,true);

CopyBuffer(g_hMA,0,0,3,fMA);

 
Alexander Antoshkin:

Greetings to the fair company of fiction makers)! After a quick read of the thread, I think I'll join you in your fiction, ....

I wanted to dedicate a couple of stocks to the author for the stock market, ......

I'm not a very good programmer too" I just did it all on the spot, so let's download a couple of stock codes and put them into my EA :)

input int period_CCI_S=100;

input int period_CCI_F=13;

I will try this variant of the channel at the weekend

I miss the clearing output on the futures market in my EA (this is a must in my opinion) !

I can compensate for what I stole with my code stocks)

input string i_sTimeSettings="Trade Time Settings"; //

input bool i_bExitClearing1=true; // close position before clearing 1

input string i_sClearing1StartTime="13:00"; // start time of clearing 1

input string i_sClearing1EndTime="13:03"; // End time of clearing 1

input bool i_bExitClearing2=true; // Close position before clearing 2

input string i_sClearing2StartTime="18:45"; // Start time of clearing 2

input string i_sClearing2EndTime="19:00"; // End time of clearing 2

input bool i_bExitEndSession=true; // Close position before end of session

input string i_sEndSessionTime="22:56"; // End Time

The idea continues

I'm not familiar with the fund yet, if you can explain what these reopenings are for in more detail. From the history I see that positions reopen by themselves during clearing

2016.03.11 13:01:16 5617377 GOLD-3.16 sell out 1.00 1 263,9
0,00 0,00 1 011,01 101 562,44 [variation margin close]
2016.03.11 13:01:16 5617378 GOLD-3.16 buy in 1.00 1 263,9
0,00 0,00 0,00 101 562,44 [variation margin open]
2016.03.11 13:01:16 5617461 Si-6.16 buy out 1.00 71 819
0,00 0,00 176,00 101 738,44 [variation margin close]
2016.03.11 13:01:16 5617462 Si-6.16 sell in 1.00 71 819
0,00 0,00 0,00 101 738,44 [variation margin open]
2016.03.11 13:01:16 5617773 SILV-3.16 sell out 1.00 15,54
0,00 0,00 2 316,89 104 055,33 [variation margin close]
2016.03.11 13:01:16 5617774 SILV-3.16 buy in 1.00 15,54
0,00 0,00 0,00 104 055,33 [variation margin open]
2016.03.11 13:01:16 5617791 LKOH-3.16 sell out 1.00 26 782
0,00 0,00 - 389,00 103 666,33 [variation margin close]
2016.03.11 13:01:16 5617792 LKOH-3.16 buy in 1.00 26 782
0,00 0,00 0,00 103 666,33 [variation margin open]
 
Sergey Gritsay:
added in the settings from what date to what date we give the result

I made a mistake with mt4, it gave out results for a day after reloading ... so why connect it, let the info work on its own - even with auto-trading disabled in the terminal, it counts just as long as there is history, no one has approached from this side - close by history's sufficiency ... but actually no - the history will have sufficiency, and the trade will have a kill...))

AUDUSD chart, M15, 2016.03.11 12:32 UTC, MetaQuotes Software Corp.