[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 729

 

I wonder what are the most traded pairs, or indices from the whole list, apart from the standard 6 pairs. ?

And what to trade at night? Where is the volatility?

What does no one know?

 

Dear programmers, I would like to ask you a question:

Is it possible (and if so how) to make the advisor itself looks through the history of recent transactions and if, for example, 2 (changeable parameter), the last transaction was unprofitable (ie, he did not commit, but is looking what would be if it has committed them), it opens a deal.

Thank you in advance for your feedback.

Boris.

 
artmedia70:

Kudos for your perseverance! Watching you try to learn the language, I am filled with a sense of respect. I will make an example of you to all those who are careless!

I will. No kidding. In all seriousness.

 
cyclik33:

Dear programmers, I would like to ask you a question:

Is it possible (and if so how) to make the advisor itself looks through the history of recent transactions and if, for example, 2 (changeable parameter), the last transaction was unprofitable (ie, he did not commit, but is looking what would be if it has committed them), it opens a deal.

Thank you in advance for your feedback.

Boris.


Your question allows for a double interpretation. Please rephrase it. You might think that the Expert Advisor should find the last two losing trades in the history and make a decision, or you might think that the Expert Advisor should simulate these two past losing trades and make a decision. It is not clear what exactly you mean.
 
drknn:

Your question allows for a double interpretation. Please rephrase it. You might think that the Expert Advisor should find the last two losing trades in the history and make a decision, or you might think that the Expert Advisor should simulate these two past losing trades and make a decision. It is not clear what exactly you mean.

Option 2. He should emulate the last 2 losing trades (in a row) and only then start to work(open a position), if he loses, he continues to work (open a position) until there is a profitable trade. If he wins, he again waits for two losing trades, and only then starts to trade.
 

Hi all.

I have a question: I ripped out another EA's trawl function and added it to my own...

I drew my EA to my own, but now it hangs in the Strategy Tester.

2010.07.21 20:16:43 2010.07.01 00:30 AlexTrade EURUSD,M30: modify #1 buy 2.00 EURUSD at 1.2234 sl: 1.2226 tp: 0.0000 ok

I think this is the issue but I can't find what exactly.

void  TrallIt() {
   int it=OrdersTotal();
   int i;
   for (i=it-1;i<=0;i--)
      {
         if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)==true)
            {
            if (OrderType() == OP_BUY&&OrderSymbol() == Symbol()) 
               
               OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Bid - StartingStopLoss * Point * dig, Digits), 0, 0, Red);
               
            if (Bid - OrderOpenPrice() > TrailingStop * Point * dig)
               if (OrderStopLoss() < Bid - TrailingStop * Point * dig)
                  OrderModify(OrderTicket(), OrderOpenPrice(), Bid - TrailingStop * Point * dig, 0, 0, Red);
               
        
        
             if (OrderType() == OP_SELL&&OrderSymbol() == Symbol()) 
            
               OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Ask + StartingStopLoss * Point * dig, Digits), 0, 0, Red);
            
             if (OrderOpenPrice() - Ask > TrailingStop * Point * dig)
               if (OrderStopLoss() > Ask + TrailingStop * Point * dig) 
                  OrderModify(OrderTicket(), OrderOpenPrice(), Ask + TrailingStop * Point * dig, 0, 0, Red);
               
            }
   
       }
 return ;
 }  
 
MarkTrade:

Hi all.

I have a question: I ripped out another EA's trawl function and added it to my own...

I drew my EA to my own, but now it hangs in the Strategy Tester.

2010.07.21 20:16:43 2010.07.01 00:30 AlexTrade EURUSD,M30: modify #1 buy 2.00 EURUSD at 1.2234 sl: 1.2226 tp: 0.0000 ok

I think this is the issue but I can't find what exactly.


for (i=it-1;i<=0;i--) ??? isn't it supposed to be like this

void  TrallIt() {

    for (int i=0; i<OrdersTotal(); i++)
      {
         if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)==true)
            {
            if (OrderType() == OP_BUY&&OrderSymbol() == Symbol()) 
               
               OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Bid - StartingStopLoss * Point * dig, Digits), 0, 0, Red);
               
            if (Bid - OrderOpenPrice() > TrailingStop * Point * dig)
               if (OrderStopLoss() < Bid - TrailingStop * Point * dig)
                  OrderModify(OrderTicket(), OrderOpenPrice(), Bid - TrailingStop * Point * dig, 0, 0, Red);
               
        
        
             if (OrderType() == OP_SELL&&OrderSymbol() == Symbol()) 
            
               OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Ask + StartingStopLoss * Point * dig, Digits), 0, 0, Red);
            
             if (OrderOpenPrice() - Ask > TrailingStop * Point * dig)
               if (OrderStopLoss() > Ask + TrailingStop * Point * dig) 
                  OrderModify(OrderTicket(), OrderOpenPrice(), Ask + TrailingStop * Point * dig, 0, 0, Red);
               
            }
   
       }
 return ;
 }  
 

so too... doesn't change anything... hangs in the same place.

Sync by honeybunny

Sorry. It works. Thanks!

 
Hi. Please answer the question: does the spread count in the strategy tester (when testing an EA)?
 
Baltimor:
Hi. Please answer the question: does the spread count in the strategy tester (when testing EAs)?
Yes.