variation price program
Forums › ProRealTime English forum › ProOrder support › variation price program
- This topic has 28 replies, 4 voices, and was last updated 2 years ago by Dovakin.
-
-
04/25/2022 at 11:02 PM #192210
Hello I would like to write this code if someone can help me I would be very grateful
I will buy the asset at the opening of each candle if its price changes by 70%. take profit yes +0.5%. stop-loss -0.5
I will sell the asset at the opening of each candle if its price changes by 70%. Take profit -0.5%. Stop-loss +0.5%.
Time unit 15min. Thank you for your understanding.04/26/2022 at 6:24 AM #19221204/26/2022 at 5:20 PM #19224604/26/2022 at 5:26 PM #192247can you please make me this code for the cac 40. On opening of each candle if the stock takes 1%. Open buy position. Close the position if it takes +1%. Stop loss -0.8% Also on each candle opening if the cac loses 1%. Open sell position. Close position if it loses 1%. Stop-loss +0.8%. time 1h. Thank you for your time.04/26/2022 at 6:23 PM #192249Variation program12345678910DefParam CumulateOrders = FalseIf Close / Close[1] > 1.01 thenBuy 1 contract at marketElsIf Close / Close[1] < 0.99 thenSellShort 1 contract at marketEndIfSet Target %Profit 1Set Stop %Loss 0.8You can adjust everything yourself:
- Number of contracts
- % stop loss
- % take profit
- Tijdframe
- Index
- …
04/26/2022 at 6:33 PM #19225004/26/2022 at 6:41 PM #19225204/26/2022 at 6:44 PM #192253I don’t know if I expressed myself badly but this is exactly what I want
each candle has an opening i want to take position from that opening. then i want to multiply that opening by 1%. and exit that candle if i am right with a 0.6% gain. if i am wrong i take a 0.3% loss. i am sorry i am a novice.04/26/2022 at 7:09 PM #19225504/27/2022 at 12:16 AM #192265For example this candle of March 16, 22 of the ndx 100 at 20:00 the opening is 13738.2. In the framework of a long position, if the asset gains 1%, I take 13738.2 and multiply by 1%. That gives me 13875.582. If I reach 13875.582 I take a buy position. If from 13875.582 I gain 0.4% I exit my buy position with a gain. In case I reach 13875.582 and I have a drop of 0.4% I exit my buy position with a loss. And I do this for each candle on a time unit of 1 hour.
In the case of a short position like this 26th of April at 3pm of the ndx 100. The opening is 13477.7. If the asset loses 1%. I take the opening which is 13477.7 which I multiple by 1%. That makes 13342.99. And then I take a sell position. If from 13342.99 I gain 0.4% I exit my sell position with my gain. If on the contrary the price goes up I exit at 0.4% with a loss. And this for each candle on a time unit of 1 hour
04/27/2022 at 8:12 AM #192271Hi @Dovakin
Variation Price Program1234567891011121314DefParam CumulateOrders = FalseIf OnMarket[1] and Not OnMarket thenOpenPrice = OpenEndIfIf Close > OpenPrice * 1.01 thenBuy 1 contract at marketElsIf Close < OpenPrice * 0.99 thenSellShort 1 contract at marketEndIfSet Target %Profit 0.4Set Stop %Loss 0.43 users thanked author for this post.
04/27/2022 at 8:46 AM #19227804/27/2022 at 9:26 AM #192281thank you Mr JS.
1<span class="Y2IQFc" lang="en">just one thing if we take this trade from April 25 at 4 p.m. it's the same for the others.</span>Entry is 13384,015 NOT ONLY 13251,5. BECAUSE I TAKE POSITON WHEN<span class=”Apple-converted-space”> </span>I HAVE OPEN*1% like here 13251,5*0,01 equal 13251,5+132,52 equal 13384,015.<span class=”Apple-converted-space”> </span>IF I HAVE 0,4% OF PROFIT I CLOSE MY POSITION LIKE 13384,015*0,4% EQUAL 13384,015+53,55 equal<span class=”Apple-converted-space”> </span>134737,55 , I close my position with profit. But if I have 13384,015*0,4 equal 13384,015-53,55 equal 13330,47 I close my position with loss.
04/27/2022 at 9:36 AM #19228304/27/2022 at 9:56 AM #192286just one thing if we take this trade from April 25 at 4 p.m. it’s the same for the others.
Entry is 13384,015 not only 13251,5. Because I take position when I have open*1% like here 13251,5*0,01 equal 13251,5+132,52 equal 13384,015.If I have 0,4% of profit I close my position like 13384,015*0,4% EQUAL 13384,015+53,55 equal 134737,55 , I close my position with profit. But if I have 13384,015*0,4 equal 13384,015-53,55 equal 13330,47 I close my position with loss.
-
AuthorPosts
Find exclusive trading pro-tools on