Trading Equity Curve

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #16691 quote
    Daniel da Costa
    Participant
    Average

    I would like too put a moving average on my equity curve and only initiate trades if the equity curve is above the moving average. I’ve tried the coding posted in another article on this forum but didn’t have much luck with it, can anyone help please?

    #16693 quote
    CKW
    Participant
    Veteran

    Sorry. Allow me to track this email if anyone have the answer. i am interested to know “How” as well..

    #16698 quote
    Nicolas
    Keymaster
    Master

    @Daniel

    Please update your country flag in your profile, thank you 🙂

    Do this code work for you?

    myequity = (((close-positionprice)*pointvalue)*countofposition)/pipsize + strategyprofit
    avg = average[20](myequity)

    It should calculate a moving average of 20 periods of the current opened orders gain plus the already made profit (strategyprofit).

    #16788 quote
    Daniel da Costa
    Participant
    Average

    Thanks Nicolas, i’ll give it a go!

    #16791 quote
    Wing
    Participant
    Veteran

    I think you will need to make your own equity curve, if you want to include simulated trades that occur while the equity curve is below the moving average.

    You do this by initiating some trades as fake, and some as both fake and real. For fake trades, you calculate the profit or loss based on your sell/stop conditions. You do this in an indicator for example, and then call it in a moving average function, allowing you to make real trades based on the value.

    #16795 quote
    Daniel da Costa
    Participant
    Average

    Thanks Wing!  That’s sort of what is was thinking of …is it possible too simulate trades in an indicator though? 

    #16810 quote
    Wing
    Participant
    Veteran

    Yes, you can, or in a trading system. You simply add a variable for when you are initiating and holding a fake trade, size of that position, initial price etc., then when reaching sell conditions, you “sell” the fake position and look at the new close compared to what you bought the fake positon at, and add this win/loss to a equity variable you create.

    #16818 quote
    Daniel da Costa
    Participant
    Average

    Thanks Wing! Good idea, I will give it a go.

    #16826 quote
    Nicolas
    Keymaster
    Master
    For your information, recently someone ask PRT about my blog article for this purpose (trading the equity curve), and why it doesn’t work with IG accounts. He got answers and another way to implement it with this account type: IG account equity curve trading code Hope it will help you.
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

Trading Equity Curve


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 8 replies,
has 4 voices, and was last updated by Nicolas
9 years, 3 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/17/2016
Status: Active
Attachments: No files
Logo Logo
Loading...