Indicator, Call, Backtest

Viewing 15 posts - 1 through 15 (of 42 total)
  • Author
    Posts
  • #205376 quote
    Dizi
    Participant
    New

    Hi,

    I am stuck with this. Can someone help in this matter?

     

    I have created an indicator with some variables which will be used as call indicator in my strategy.

     

    I do not know how to created  formula/script which will use these variables via backtest in my strategy to choose the best one.

     

    Regards

    Maciej

    Zrzut-ekranu-2022-12-8-o-10.17.05.png Zrzut-ekranu-2022-12-8-o-10.17.05.png Zrzut-ekranu-2022-12-8-o-09.55.01.png Zrzut-ekranu-2022-12-8-o-09.55.01.png
    #205382 quote
    JS
    Participant
    Senior
    Hi @Dizi

    What do you want the indicator to do?

    What your indicator does now is check whether “Average[20](Close) – Average[50](Close) >

    5/10/15/20 (5 divided by 10 divided by 15 divided by 20= 0.001666)

    Is that the intention?

    #205384 quote
    Dizi
    Participant
    New
    Hi,   The intention in strategy is ;
    If Average[20](close)-Average[50](close)> 5 or 10 or 15 then
    Buy at market
    Endif
    I wish not to show this into a strategy so I was told to create an indicator and use call an indicator in a strategy.
    However, I do not know how to create this indicator and then give an option of backtesting strategy to find out if 5, 10 or 15 is better.
    #205389 quote
    JS
    Participant
    Senior

    You don’t have to use a “Call”.

    When you use this code in your strategy, you can optimize the strategy…

     
    xValue = 0
    While xValue <> 20
    xValue = xValue + 5
    If Average[20](Close) - Average[50](Close) >= xValue then
    Buy 1 contract at Market
    EndIf
    WEnd
    
    #205391 quote
    Dizi
    Participant
    New
    Yes I  know but I do not wish to show this into a strategy as I will be visible.   That is the reason I would like to create an indicator and use option call in a strategy.
    #205395 quote
    JS
    Participant
    Senior
    Step 1: Create your indicator (Name indicator = Dizi) xAvg20 = Average[x1](close) xAvg50 = Average[x2](close) xDiff = xAvg20 – xAvg50 Return xDiff (Parameters: x1=20 and x2=50) Step2: Create your strategy (Parameter: xValue= 0 to 20 step 5) DefParam CumulateOrders=false MyDizi = Call “Dizi”[20.50] If MyDizi > xValue then Buy 1 contract at market ElsIf MyDizi < xValue then SellShort 1 contract at market EndIf
    #205397 quote
    JS
    Participant
    Senior
    Last “EndIf” on a new line…
    #205401 quote
    JS
    Participant
    Senior
    When you “play” with the different values, you get nice results…
    Scherm­afbeelding-2022-12-08-om-14.46.05.jpg Scherm­afbeelding-2022-12-08-om-14.46.05.jpg
    #205403 quote
    Dizi
    Participant
    New
    I cannot believe you are Genius 🙂
    Thanks a lot.
    My I have one more question.
    Is there an option of adding these parameters into the script so when someone will use this script the parameters will be automatically added into backtest ?
    #205404 quote
    JS
    Participant
    Senior
    That is possible, replace the parameters with the values you want to use in your code… For example: xAvg20=Average[x1](Close)  xAvg20=Average[20](Close) or If MyDizi > xValue then  If MyDizi > 10 then
    #205405 quote
    Dizi
    Participant
    New
    Please find the attached picture.
    I would like the values from backtest to be added somehow into the script  so when someone will use this script these values will be automatically added into backtest mode.
    Zrzut-ekranu-2022-12-8-o-14.11.19.png Zrzut-ekranu-2022-12-8-o-14.11.19.png
    #205410 quote
    JS
    Participant
    Senior
    When you specify these values (parameters) in your strategy (as in your screenshot) then everyone who uses the strategy will work with these values… (Do you mean that?)
    #205411 quote
    Dizi
    Participant
    New
    Yes. I would like these to be predefined exactly as in the picture and added automatically so someone will only have to click backtest and choose the optimised one.
    #205413 quote
    JS
    Participant
    Senior
    That’s right, that’s exactly what happens when you include these parameters in your strategy under the “optimization parameters”…
    #205418 quote
    Dizi
    Participant
    New
    Thank you kindly.   I have been working on this strategy for last few months. I have added the missing part with you help.   I have been live for last few weeks and it brings +100% every month. Please check the attached picture.
    JS thanked this post
    Zrzut-ekranu-2022-12-8-o-15.02.42.jpg Zrzut-ekranu-2022-12-8-o-15.02.42.jpg
Viewing 15 posts - 1 through 15 (of 42 total)
  • You must be logged in to reply to this topic.

Indicator, Call, Backtest


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Dizi @dizi Participant
Summary

This topic contains 41 replies,
has 7 voices, and was last updated by UKTrader
3 years, 2 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/08/2022
Status: Active
Attachments: 22 files
Logo Logo
Loading...