Simulation savings plan once a month

Forums ProRealTime English forum ProOrder support Simulation savings plan once a month

Viewing 3 posts - 1 through 3 (of 3 total)
  • #227290

    So far I have failed to code a kind of ETF savings plan simulation. A savings plan works like this… on the 1st or last day of each month you buy a share of an ETF, for example SP500. So that means cumulative orders true. That would be the standard. But I want to know whether it is really better to only buy when the price is above a certain MA, the standard here is usually the SMA200 in Daily. And then whether it is better to sell all shares if the price slips below this SMA or to simply hold and not buy any new shares. What I’m having trouble with is that the code only buys once a month, cumulate Orders=true

    Can someone please code this simulation for me?

    #227654

    This is the code:

    you may add your conditions to the entries, apart from the day.

     

     

    #227660

    That looks good. Thanks Roberto.

Viewing 3 posts - 1 through 3 (of 3 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login