Forum

(Edited to Elaborate and Repost) Wrong Lotsize Calculation

Hello, I am learning to code and came across these 2 functions that calculate the optimal lot size for the order. I tried both of them however, they are both giving me a bigger than supposed lot size sometimes (e.g. returns a 1.5 lot size for a $1000 account, or a 2.94 lot size for a $10000 account)

Wrong Lotsize in Order Execution

Hello, I am learning to code and came across these 2 functions that calculate the optimal lot size for the order. I tried both of them however, they are both giving me a bigger than supposed lot size sometimes (e.g. returns a 1.5 lot size for a $1000 account) so it's causing an error 134 all the

Help Needed for Order Execution

(Rewriting this post to make it more clear) Hello, I am developing my first EA with the strategy of: for buy orders and sell orders are vice versa 1. EMA9 and price are both above EMA225; 2. a pullback happened and price went below EMA9, then price crosses again and close above EMA9 (the Close [1])

Help needed for if conditions

Hello, new to coding here. Can someone please tell me are the if conditions contradicting here? It's a strategy combining EMAs and Stochastics. It is not giving me any order when I backtest it. But if I separate the EMA and Stochastic conditons, it works. Attached is an example of the strategy