Invalid Stops - page 2

 
what are values of StopLoss and TakeProfit variables ?
 
input double                  StopLoss                      = 650;
input double                  TakeProfit                    = 0;

These are the parameters.


At my simulation values goes like this :



 

AFAIK, the reasons for Invalid Stops error are :

  • invalid price : negative values, stoploss above bid in buy, Stoploss below ask in sell, non-tick-size-rounded prices...
  • in freeze range : Stoploss too close to current market price...
you should check the validity of calculated Stoploss price, before sending modify
 

In my case I believe the error is causes for price in impossible value. I can't leave an operation on a value different from xxxx5 or xxxx0 by cause my tick size is always multiple of 5.

The first stop goes well, by cause my entrance value is "clean", finishing with 0 or 5. But when I enter again, the new calculation is with medium price, which could finish with any number, from 0 to 9.

 

What is the difference between both prices? Maybe i could use another source of price to make the calculation, to avoid this error.

 
Print(SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE));
it prints 5.0000000 ?
 
Code2219 or probably 2319:
it prints 5.0000000 ?
Where should I put this?
 
make a new script, copy paste this in its content, compile it, and drag it on the chart. :)

void OnStart()
{
        Print(SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE));
}
then read the Expert tab, inside ToolBox
 
Code2219 or probably 2319:
it prints 5.0000000 ?

By this you made me think...

I test on an series, like WIN$N. Every month i change from WING19 to WINF19 and so on...
I tried on WING19 (current) and it worked... It might be a problem between the code and the series!!!! Thanks!!!

What should i do to get the right information from the series?

 
Lucas Tavares:

By this you made me think...

I test on an series, like WIN$N. Every month i change from WING19 to WINF19 and so on...
I tried on WING19 (current) and it worked... It might be a problem between the code and the series!!!! Thanks!!!

What should i do to get the right information from the series?

Never mind, just in the one date that I tested it worked, also it worked on both series and specific.
In others dates it still not working.