zero divide error on demo testing but not ST? - page 2

 

They've had server issues for the first time in aggggggges today actually. So the server has been down and out for 30 minutes. Quite frustrating as I missed a great short on cable. 

Maybe that has messed it up?

For future reference, how can I build this issue into my algorithm if this happens again? I.e. if the MarketInfo gets scrambled temporarily and returns unusable or irrelevant numbers?  

 
gooly:
Try SymbolInfoDouble("USDCAD",SYMBOL_TRADE_TICK_SIZE) and ask your broker may be the server is not correct?

Ok so this still returns "0"....

 Wow this has completely stopped my trading. 

 

So none of the markets on FXCM platform are returning a tick size. Some are not even returning the tick value either (facepalm). Disaster.

How can I synthetically formulate these values?  

 
I'm now getting a ticksize and value on my windows MT4 FXCM platform (same account) BUT I am not getting a value on my VPS MT4 FXCM platform within my VPS!? What the heck is going on! They're the same account, version, broker etc.!
 
Anyone able to help me produce these values synthetically as opposed to just simply relying on the brokers MarketInfo()?  
 

1) Talk to your broker!

2) Try Print("Tick size in points=",MarketInfo(Symbol(),MODE_TICKSIZE),"  ",_Point);

 

Wow this is chaos. FXCM is having MAJOR issues over the past hour+. They're offline again.

If I could talk to my broker that would be great! Impossible to get through. I'd imagine everyone is going mental right about now. 

Is there not a way for me to produce these values rather than depend upon the brokers server information? 

 
  1. DomGilberto: Is all I can think of? 

    double loss_for_1_lot = pips_to_bsl / ( ts * tv ); // brackets?

    Account Balance * percent = RISK = (OrderOpenPrice - OrderStopLoss)*DIR * OrderLots * DeltaPerlot (Note OOP-OSL includes the SPREAD) Do NOT use TickValue by itself - DeltaPerlot

    Therefor it must be

    pips_to_bsl / ( tv / ts )
    or the original
    pips_to_bsl / ts / tv 
  2. But pips_tl_bsl had better not be pips. It must be a change of price (0.0200 not 200 pips)
  3. zero divide error on demo testing but not ST?

    Were are you setting those variables? It says somewhere that the values should be retrieved in OnStart not in OnInit()
 

Zero divide was from brokers server side issue. It's since been resolved. It was because ticksize was "0" for a bit whilst a trade was being placed. Therefore the lots formula was dividing by a "0". 

I've read your DeltaPerLot thread before but tbh don't really understand it. Just a little slow tbh.

  

pips_to_bsl / ts / tv // works

pips_to_bsl / ( tv / ts ) // doesn't work - errors
 

a bit math: a / b / c = a*c/b (you don't even need brackets) :)

it saves a zero-devide-check!

Reason: