[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 266

 
hoz:

In the parameter of the function itself we see:

fi_Ticket = 0

Usually such functions are called after the orders have been selected, which means they will have a ticket. Why then assign the default value to zero?

If we call the function without this parameter, not a single if will be executed, and the function will start with the string

RefreshRates();

The next step is even more interesting:

if (fs_Symbol != bs_Symbol || fi_Ticket < 0)
{
   if (fi_Ticket > 0)
   {
      bs_Symbol = OrderSymbol();
   }
   else
   {
     bs_Symbol = fs_Symbol;
                  }
                  if (bs_Symbol == Symbol())
                  {
                      bi_SymDigits = Digits;
                      bd_SymPoint = Point;
                  }

The variable fs_Symbol is immediately compared to bs_Symbol.

Thebs_Symbol above has not been initialized, where thefGet_MarketInfo()function itself is called. And what is this bs_Symbol for anyway? If the library compiles without errors,

If the library compiles without errors, then bs_Symbol variable must be declared somewhere at global level. There (or in some other function) one should search for its initialization...

Also in the condition:
if (fs_Symbol != bs_Symbol || fi_Ticket < 0)

Iffi_Ticket < 0, the next thing to do...

if (fi_Ticket > 0)
{
   bs_Symbol = OrderSymbol();
}

and this already contradicts the condition. At the beginning of the code thefi_Ticket < 0 condition must hold, and then within this condition the ticket > 0. Where is the logic?

Note: the conditionfi_Ticket < 0 OR fs_Symbol != bs_Symbol must hold for the code to work, which means that if there is further if (fi_Ticket > 0) at the end of the code, just that alternative entry condition is implied.
 

Hi all! Can you help me, I can't seem to make sense of this)))

 
kera8383:

Hi all! Can you help me, I can't seem to make sense of this)))

Start with the FAQ.
 
tara:

You are probably using unacceptably small StopLoss and TakeProfit values, but that's just a guess. There is not enough information.


No, my stops are big, I have the values below.

         SL=Ask + StopLoss*Point;     // значение StopLoss = 375
         TP=Ask - TakeProfit*Point;   // значение TakeProfit = 550
 
paladin80:

Do not normalise the stops inside OrderSend. Do this before RefreshRates and then substitute. Print these values to be sure they are correct. By the way, learn to open a position without a stop, as there are brokerage companies which do not accept orders with stops. After setting one, modify the stops - it will pass.

Very small slippage = 2. The example gives 3 and that's on 4-digit quote. If you set such an EA on 5-digit quote, the slippage will be 0.2 points. There will definitely be errors.

Thanks for the wise advices, I have taken them into account. I have fixed the error. The reason is simple: Alpari brokerage company andECN demo account type. I have to open an order and then modify it.
 
cheerful time of day everyone... Gentlemen please help, there is such a problem.... i'm testing my forex robot at alpari, it works on another brokerage company, i've been working with forex robot for three weeks and the results are different. I did some digging (of course I got nervous too..... piii) and i realised that the indices of indicator RSI, that is used in calculations are slightly different from those that show the same indicator at Alpari. Trouble..... the difference is in "microns :)" but oooh it's enough to change the EA. Guys please advise how to fix this kind of thing, thank you very much!
 
laveosa:
cheerful time of day to all ... gentlemen help please, here's the problem .... i'm testing my forex Expert Advisor on Alpari but i'm using another brokerage company, i've been using it for 3 weeks on demo and the results are different. I did some digging (of course I got nervous too..... piii) and i realised that the indices of indicator RSI, that is used in calculations are slightly different from those that show the same indicator at Alpari. Trouble..... the difference is in "microns :)" but oooh it's enough to change the EA. Guys please advise how to fix this kind of thing, thank you very much!


The quotes from different DCs are different. Demo - from real - also. Indices are the same.

It's necessary to test and check expo and indicator parameters on the history of brokerage company you are going to play with...

And the expo has to be adjusted for real(error handling and all the rest...).

 
StringSetChar does not work in the code. You need to replace ":" with "." .

                        string    Object_Date_Secnd = TimeToStr(Object_Time,TIME_SECONDS);

                        for(int s1=0; s1<StringLen(Object_Date_Secnd); s1++) {
                           if(StringGetChar(Object_Date_Secnd,s1)==':' ) {
                              StringSetChar(Object_Date_Secnd,s1, '.');
                           }
                        }


- Why is the replacement not working?

Thank you!

 
So if the TS was different at Alpari, it's not a guarantee that it will bring the same results at another brokerage company? And how can we adjust it on another brokerage company if its history is not as complete as on Alpari, for example? Closer to the body, is it possible to adjust indices on another brokerage company so that they are identical to those on Alpari for example?
 
laveosa:
So if the TS was different at Alpari, it's not a guarantee that it will bring the same results at another brokerage company? And how can we adjust it on another brokerage company if its history is not as complete as on Alpari, for example? Closer to the body, can we adjust the indicator on another brokerage company so that it would bring the same results as on Alpari for example?

You can - that's it... It would be useful to do such setting. Look at the stories from MetaQuotes.