Expert Advisors: The "Night" Expert Advisor

 

The "Night" Expert Advisor:

An Expert Advisor for trading during the night.

Thos Expert Advisor trades on EURUSD (M15), according the signals of Stochastic indicator. It uses a simple money management system.

Author: AM2


The Night Expert Advisor test results


 
A little did not understand the meaning of the EA, it does not show profit, and to make the EA traded only at night is not difficult ...
 
mrProF:
A little did not understand the meaning of the EA, it does not show profit, and to make the EA traded only at night is not difficult ...

I wrote this EA in order to test the effectiveness of trading at night. Maybe you can tell me how to make it profitable?

Now I am thinking how to make the EA make only one trade per night. I haven't figured it out yet.

 
And why don't you use OnTrade events?
 
DC2008:
And why don't you use OnTrade events?

This is still new to me. I'm going to look at an article about it now.

 
DC2008:
Why don't you use the OnTrade event?

Many people don't use it yet, and they should...
 
AM2:

I wrote this EA in order to test the effectiveness of trading at night. Maybe you can tell me how to make it profitable?

Now I am thinking how to make the Expert Advisor make only one trade per night. I haven't figured it out yet.

First you should make it consistently break-even, and then think about profit.

What is there to think about: add one variable (or class property if OOP), "in the morning" set it to 0 or false (depending on the implementation), and "in the evening" control its value to catch the fact of transactions.

 
Interesting:

You should start by making it consistently break-even, and then think about profit.

What is there to think about: add one variable (or class property if OOP), set it to 0 or false (depending on the implementation) in the "morning", and control its value in the "evening" to catch the fact of transactions.

If only it were that simple... I used to set a global variable OrderCount.

Zeroed it in the morning:

if(dt.hour >= 7 || dt.hour <=20)
 {
  OrderCount=0;
 }

Monitored the value:

   if(Buy_Condition && (!PositionSelect(_Symbol)))
     {
      if(dt.hour >= 23 || dt.hour < 6)
       { 
       if(OrderCount<1)
        {
         // Здесь торгуем
        }
       OrderCount++;
      }
     }
   

So no change. Trades for the whole period. Several trades.

Without zeroing it makes only one trade for the whole period. I tried also with bool and with flips and separately for buy and sell variables.

Can I control the time of the last trade?

 
AM2:

If only it were that simple... I set the global variable OrderCount.

I reset it in the morning:

Control the value:

So no change. Traded the entire period. Multiple trades.

Without zeroing it makes only one trade for the whole period. Tried also with bool and with flips and separately on buy and sell variables.

Maybe I should also control the time of the last trade?

I looked at the Expert Advisor, I will think about how to make the code more interesting (without going into the basic logic)...
 

And a funny report came out on testing since 2000.

tester parameters: Currency - EURUSD, TF - 4H, Depo - 10 000$.


Files:
night-eur-4h.zip  592 kb
 
Interesting:

And a cool report came out on testing from 2000.

tester parameters: Currency - EURUSD, TF - 4H, Depo - 10 000$.

Is it with one trade per night or did you change something else, except for the timeframe? I looked at the test and the rest remained the same.

The MASTER'S business is afraid! )))