Moving Averages Drawing Delay

Created at 18 Nov 2015, 23:39
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
J.

j.kozlowski.net

Joined 15.11.2015

Moving Averages Drawing Delay
18 Nov 2015, 23:39


Could you please give me a hint on how to programmatically solve an issue with Moving Averages being drawn only after number of bars specified by MA period have passed?

To make it clear I need to use an example. My algo opens a long position only if the current bid price is above Weighted Moving Average. Conversely, a short is opened with prices below the wma. Now, the problem is that when backtesting, on daily bars, the robot does not respect this criterion until specified period (let's say 150 bars) has passed, meaning that it opens both long and short positions regardless of WMA value.

My worry is that this will also be the case in real time testing.

Any suggestions, please?


@j.kozlowski.net
Replies

Spotware
23 Nov 2015, 02:40

Dear Trader,

We do not provide coding assistance services. We more than glad to assist you with specific questions about cAlgo.API. You can contact one of our Partners or post a job in Development Jobs section for further coding assistance.


@Spotware