Forum

CTrade Closing Position

I have a trailing stoploss EA that I use to just close positions. The code I have drops the SL price along with other info in the EA log. The issue I have is with the code I use to close the order. For some reason it makes it to the expressions as if the CPositionInfo::Select() and the

Horizontal lines

Where do I read about copying horizontal lines from a window in one timeframe to another window with a different timeframe? I would like to know if I could just copy and paste objects inter-windows

Cleanest way to do this

What is the cleanest way of ending an indicator from within the OnCalculate? Also is it acceptable to call OnInit from within OnCalculate? What impact will that have on prev_calculated? If the int OnInit() is used, and it is called from within OnCalculate, and returns a non zero value (error) will

Question about for loop iteration to optimize

Just wondering if I define an int bar in the scope of OnCalculate and later I use a for loop such as for(bar=prev_calculated; bar<rates_total/units_per_bar; bar++) will bar retain the incremented value after iterations or is the bar variable in the for loop working in a different scope? I am