ProOrder putting wrong trades

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #223998 quote
    VarmaRudra
    Participant
    New

    Hi All,

    I written a program for automated trading and use this below indicator logic as a condition to put the trade. It used to work fine till last week but from today onwards its not working. In other words, it is not returning 1 when the last ten candles close price consistently above EMA20.

    When i tested it further, until i check last four candles(including the current one) it works perfectly but when i increase it to last five candles it is giving abnormal results.. attached some screenshots related to this.

    Lost quite a bit of money because of abnormal trades system put in. So, Any insight into this will be much appreciated.

    EXPA20 = ExponentialAverage[20](close)
    EXPA50 = ExponentialAverage[50](close)
    
    i = 0
    CloseABoveEXP20 = 1
    
    While i <> 10 DO
    if  EXPA20 > close[i] then
    CloseABoveEXP20 = 0
    Endif
    i = i+1
    WEND
    
    return (CloseABoveEXP20 and open > EXPA20 and close > EXPA20)
    Trading-analysis.docx
    #224006 quote
    JS
    Participant
    Veteran

    Hi @VarmaRudra

    Try this one…

     

    ExpA20 = ExponentialAverage[20](close)
    ExpA50 = ExponentialAverage[50](close)
    
    N=5 //Number of bars to check
    
    C1=Summation[N](Close>ExpA20)=N
    
    If C1 then
    Signal=1
    Else
    Signal=0
    EndIf
     
    Return Signal
    VarmaRudra thanked this post
    Scherm­afbeelding-2023-11-21-om-08.12.30.png Scherm­afbeelding-2023-11-21-om-08.12.30.png
    #224014 quote
    VarmaRudra
    Participant
    New

    You are a star. Thank you. I wonder why it stopped working from Yesterday. I always that logic but your program is much better.

    JS thanked this post
    #224058 quote
    PeterSt
    Participant
    Master

    Try this one…

    Hi JS,

    Why would that help, you think ?
    (I had been staring at the issue for 15 minutes before I gave up)

    #224061 quote
    JS
    Participant
    Veteran

    Sorry, I don’t understand your question…

    #224072 quote
    robertogozzi
    Moderator
    Master
    This code works fine:
    EXPA20 = ExponentialAverage[20](close)
    CloseABoveEXP20 = summation[10](close > EXPA20)
    return (CloseABoveEXP20 and open > EXPA20 and close > EXPA20)
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

ProOrder putting wrong trades


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
VarmaRudra @varmarudra Participant
Summary

This topic contains 5 replies,
has 4 voices, and was last updated by robertogozzi
2 years, 3 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/20/2023
Status: Active
Attachments: 2 files
Logo Logo
Loading...