Change positionsize when going live
Forums › ProRealTime English forum › ProOrder support › Change positionsize when going live
- This topic has 12 replies, 3 voices, and was last updated 1 year ago by robertogozzi.
-
-
08/08/2023 at 1:30 PM #218735
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
123IF L1 AND L2 AND L3 AND L4 THENBUY AT MARKETENDIF08/08/2023 at 2:47 PM #21873608/08/2023 at 10:30 PM #218749123IF L1 AND L2 AND L3 AND L4 THENBUY X Contracts AT MARKET //change X to your preferenceENDIFThanks 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.
08/09/2023 at 7:42 AM #218759marketplace 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.
1 user thanked author for this post.
08/09/2023 at 8:04 AM #218768marketplace 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
08/09/2023 at 8:53 AM #218770Doesn’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.
08/09/2023 at 10:25 AM #218784This 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?
123456789(Indicator)Buy1 = L1 and L2 and L3return Buy1 AS "Buy1"(Strategy)Buy1= CALL "Indicator"IF Buy1 THENBUY 1 Contract AT MarketENDIF08/09/2023 at 10:33 AM #21878808/09/2023 at 10:44 AM #21879208/09/2023 at 10:50 AM #218793There must be some error in the indicator.
08/09/2023 at 10:51 AM #218794Lines 1 and 5 need to be either removed or commented out.
1 user thanked author for this post.
08/09/2023 at 2:50 PM #218838I 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
1234TIMEFRAME (1hour)indicator30 = Average[X20](close)c3 = (close >= indicator30)TIMEFRAME (default)08/09/2023 at 5:42 PM #218847Did you use a 1-hour timeframe (or smaller, if 1 hour, or 60 minutes, are a multiple of it)?
-
AuthorPosts
Find exclusive trading pro-tools on