Forum

USD pair lot sizes are off

I have an EA that i use for back testing and figuring out my strategy. I am using the 1.5 times the ATR for my stoploss and I am using $20,000 for my risk. Everything is perfect for 25 currency pairs , but the 3 pairs that have USD as the base currency are being calculated wrong. I can't figure it

Counting the number of Stop losses in a back test

Im trying to count the number of stop losses that were triggered during a back test.. Right now, I've been working on getting a condition that will trigger every time a stop loss is hit. The problem i'm having is if a stop loss is hit and then a new trade is immediately opened, the condition is

Getting an error on ticksize

I'm getting an error, can't divide by 0 when i try to run my EA on AUDCAD. I'm pretty sure i've narrowed it down to: MarketInfo( Symbol (), MODE_TICKSIZE). If i print that. It returns 1e-5 double LotSize = MarketInfo( Symbol (), MODE_LOTSTEP); double riskAmount = AccountFreeMargin() * (Risk /

new to coding, need help

Ive just started coding. Ive been watching loads of videos. Im trying to code an expert advisor but im having trouble. The current thing that im working on that im strugling with is trying to make a counter that will count how many bars its been since price closed above a moving average. This is