Forum

How does leverage affect backtesting ?

I thought leverage only affects margin requirement in a forex account but when I launch my backtest, a higher leverage will produce different results. How can I reproduce the leverage that act only on margin requirement like a classic forex trading account

I need to compute pivot lines every day. Any idea why my code doesn't work ?

CTrade trade; datetime M5, D1; int yesterday; double pivotVal, res1, supp1; int OnInit () { M5= iTime ( Symbol (), PERIOD_M5 , 0 ); D1= iTime ( Symbol (), PERIOD_D1 , 0 ); yesterday = 0 ; return ( INIT_SUCCEEDED ); } void OnTick () { if (D1!= iTime ( Symbol (), PERIOD_D1 , 0 )) {