GRAPH function. Why did my position open/close/change? little tip / debug

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16300 quote
    Philippo
    Participant
    Average

    Hi, when doing backtest,  something I found helpful  and simple to do in case of multiple entry and exit reasons in your code (e.g. risk management, technical indicator, time of day, wrong president got elected etc. etc. etc.)

    After every trade instruction assign a numeric code, enter is + and exit is –

    Extra: I was thinking of organising it so: Long entry +ve green, Long exit +ve red and Short entry -ve green, Short exit -ve red…but not got round to it yet.

     

    //
    //other code
    //
    
    // if positionperf is loser
    if longonmarket and (positionperf<PositionPerfRisk) then
    SELL AT MARKET
    exitreason=-3
    ENDIF
    
    if shortonmarket and (positionperf<PositionPerfRisk) then
    EXITSHORT AT MARKET
    exitreason=-4
    ENDIF
    
    //
    //other code
    //
    
    
    graph enterreason coloured (0,255,0) as "Entry"
    graph exitreason coloured (255,0,0) as "Exit"
    
    ALE thanked this post
    Screen-Shot-2016-11-10-at-11.06.55.png Screen-Shot-2016-11-10-at-11.06.55.png
    #16598 quote
    ALE
    Moderator
    Master

    … wrong president 🙂

    #16900 quote
    marty1974
    Participant
    New

    ciao puoi contattarmi?

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

GRAPH function. Why did my position open/close/change? little tip / debug


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Philippo @philipd Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by marty1974
9 years, 3 months ago.

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