How to convert the indicator into a buy-sell system

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #155909 quote
    Tony40
    Participant
    Junior

    Moving Average Angle (Stochastic)

     

    The system buys long when it gives the first buy signal (green).

    The system closes long when it gives the first close signal (red).

     

    Thank!!!

    Screenshot_1.png Screenshot_1.png
    #155940 quote
    nonetheless
    Participant
    Master

    You could start with something like this:

    //Calculate angle of MA
     
    MAPeriod = 40
    SamplePeriod = 5
    AngleThreshold = 45
     
    MA = average[MAPeriod](close)
    MAAngle = (sin(atan((MA-MA[1])/MA[1]*100)))*1000//R2[MAPeriod](close)*100
     
    AverageAngle = Average[SamplePeriod](MAAngle)
    AverageAngle2 = Average[round(SamplePeriod/2)](MAAngle)
     
    If AverageAngle > AngleThreshold Then
    buy 1 contract at market
    endif
    If AverageAngle < (AngleThreshold*-1) Then
    sellshort 1 contract at market
    EndIf
     
    
     
    
    #155942 quote
    Tony40
    Participant
    Junior

    It is not the Nonethless idea.

    The system is long only.

    And you should only buy a position when the indicator is green.

    And sell the position when the indicator is red.

    I put some black bars on the graph.

    The first is where you should buy the long, when the indicator turns green.

    Then he would give another signal to buy long, but since he has already bought the previous signal, he skips it.

    Finally close the long when the indicator turns red, at the second black bar.

    Screenshot_2-1.png Screenshot_2-1.png
    #155945 quote
    nonetheless
    Participant
    Master

    not tested:

    MAPeriod = 40
    SamplePeriod = 5
    AngleThreshold = 45
     
    MA = average[MAPeriod](close)
    MAAngle = (sin(atan((MA-MA[1])/MA[1]*100)))*1000//R2[MAPeriod](close)*100
     
    AverageAngle = Average[SamplePeriod](MAAngle)
    AverageAngle2 = Average[round(SamplePeriod/2)](MAAngle)
     
    If notonmarket and AverageAngle > AngleThreshold Then
    buy 1 contract at market
    endif
    If AverageAngle < (AngleThreshold*-1) Then
    sell at market
    EndIf
    Nicolas thanked this post
    #155954 quote
    Tony40
    Participant
    Junior

    Perfect!!!

    #155993 quote
    Monobrow
    Participant
    Senior

    Perfect!!!

    Now all you need to do is pick the colour of your Ferrari 😬

     

    P.S make sure you press Thanks for his time 👍

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

How to convert the indicator into a buy-sell system


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Tony40 @tony40 Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by Monobrow
5 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/02/2021
Status: Active
Attachments: 2 files
Logo Logo
Loading...