Change positionsize when going live

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #218735 quote
    T-rader
    Participant
    Average

    Hi,

    I want to share a code with some friends and maybe even go on to renting it out on the marketplace if everything goes well. How do I manage the positionsizing? I use the code that I have written below and thought that you could write like “5” contracts when you start the code in the “Max position” box but it dosent work and it only takes minimum position (dax 1 contract). How can I change the code so that my friend or eventually a renter could change the positionsize theirself? Thanks

    IF L1 AND L2 AND L3 AND L4 THEN
    BUY AT MARKET
    ENDIF
    #218736 quote
    GraHal
    Participant
    Master
    IF L1 AND L2 AND L3 AND L4 THEN
    BUY X Contracts AT MARKET //change X to your preference 
    ENDIF
    #218749 quote
    T-rader
    Participant
    Average

    Thanks but I don´t mean in the code.

    I mean when I´m going to start the code. I want to send a invisible code to my friend so he can´t change the code and if you put it up on the marketplace theres no way for the customer to change the code so there must be a other way to write the code so the positionsize can be changed when it´s started.

    Skarmklipp172.jpg Skarmklipp172.jpg
    #218759 quote
    GraHal
    Participant
    Master

    marketplace theres no way for the customer to change the code

    You need to ‘call’ the parts of your Strategy that you don’t want customers to see.  You will find how to ‘call’ Indicators etc in Guides on MarketPlace and on this website.

    You will not mind customers seeing code for position size and so this part of your code would not be hidden behind the ‘call’ Indicators etc aand so customers can change.

    Your screenshot shows the max position size that a strategy code cannot go above and so it serves as a safety net in case we get something wrong in our coding.

    T-rader thanked this post
    #218768 quote
    T-rader
    Participant
    Average

    marketplace theres no way for the customer to change the code

    You need to ‘call’ the parts of your Strategy that you don’t want customers to see. You will find how to ‘call’ Indicators etc in Guides on MarketPlace and on this website.

    You will not mind customers seeing code for position size and so this part of your code would not be hidden behind the ‘call’ Indicators etc aand so customers can change.

    Your screenshot shows the max position size that a strategy code cannot go above and so it serves as a safety net in case we get something wrong in our coding.

    I see. So I need to convert my base code to an indicator insead and call it. I will see if I can figure it out, I have several sell conditions that are based on pips and so on. Guess I have to do some reading

    #218770 quote
    GraHal
    Participant
    Master

    Doesn’t have to be an Indicator as such, you can call conditions, then display the result (maybe as a Flag, BuyCond = 1) in the code that customers can see.

    Btw there’s no need to ‘Quote’ entire posts, esp when there is only two posters.  If there is a particular small part of a post that saves us retyping to answer, or if querying part of a post way back etc, then we Quote it. Keeping Quoted text to a minimum makes for easier reading overall through the Topics.

    #218784 quote
    T-rader
    Participant
    Average

    This is new to me. I have only worked in strategys before without the call function. I made an indicator and inserted the buycondition in the strategy but I get following error even tho I don´t have code below line 20 in my code?

    (Indicator)
    Buy1 = L1 and L2 and L3
    return Buy1 AS "Buy1"
    
    (Strategy)
    Buy1= CALL "Indicator"
    IF Buy1 THEN
    BUY 1 Contract AT Market
    ENDIF
    Skarmklipp173.jpg Skarmklipp173.jpg
    #218788 quote
    GraHal
    Participant
    Master

    I’ve never done it either (I might have a go now!) but try naming your Indicator as Indicator1 and see if makes any difference?

    I’m sure JS or Roberto will be along soonn to help you.

    #218792 quote
    GraHal
    Participant
    Master

    Mine works with Indicator named as Indgh 

    #218793 quote
    robertogozzi
    Moderator
    Master

    There must be some error in the indicator.

    #218794 quote
    robertogozzi
    Moderator
    Master

    Lines 1 and 5 need to be either removed or commented out.

    GraHal thanked this post
    #218838 quote
    T-rader
    Participant
    Average

    I can add the indicator to my chart and it show my buy signals so I thought that the problem was in the “call” part. At line 37 I wanted information for another timframe (attached) and that dosen´t seem to work

    TIMEFRAME (1hour)
    indicator30 = Average[X20](close)
    c3 = (close >= indicator30)
    TIMEFRAME (default)
    #218847 quote
    robertogozzi
    Moderator
    Master

    Did you use a 1-hour timeframe (or smaller, if 1 hour, or 60 minutes, are a multiple of it)?

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

Change positionsize when going live


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
T-rader @t-rader Participant
Summary

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

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