Supertrend on MTF
Forums › ProRealTime English forum › ProOrder support › Supertrend on MTF
- This topic has 19 replies, 2 voices, and was last updated 3 years ago by
Jodal.
-
-
06/07/2022 at 7:23 PM #194868
Hi Roberto,
Thanks a lot for your help!
Understood for the non time-based charts.
Yes I am aware it will rarely stop right on the limit, thanks
I still see one issue.
I have the feeling that the 100 euros daily limit is kind of used as a TP.
For example, when the day starts with a losing trade of let’s say 100 points and then there is an ongoing winning trade, it should go up to 200 points (go back to breakeven + make 100 in profit) and not stop at 100 points.
That is what happened on March 03/03. See attached.Another example, on Graph 2802022, the last circled trade should not happen (it should go on until all the loss is compensated with the ongoing win + daily target profit.
I am not sure it is clear, please let me know if I need to elaborate.
Do you think that is possible to fix?
Enjoy your evening!
Jo06/08/2022 at 5:46 PM #194939“I have the feeling that the 100 euros daily limit is kind of used as a TP“, yes, that’s correct, as you requested in your first post. I only forgot to disable trading after that. Now it’s working as desired.
As to doubling the TP after a loss… wel at a loss it stopped for that day.
What are you goals in case of either a
- loss
- gain
?
1 user thanked author for this post.
06/08/2022 at 7:42 PM #194944Hi Roberto,
“Now it’s working as desired”, you did not attach any code, did you change the latest one you sent?
I do not want to double the TP after a loss, maybe I should have taken a different number. I just want to take into account that loss(es) when deciding if the robot should continue trading.
For example, if the first trade was a loss of 35 points, it should try to get 135 points until the end of the day to be in profit of 100 points.
At any point in time, the robot should know where we are in terms of ongoing profit (gains/losses of previous trade + floating profit).
If the total loss of previous trades amounts for 32 points, it should go for 132 points.
If the total profit of previous trades amounts for 27 points, it should still go for 73 points. So if the current trade reaches 73 points, it should stop.
So total profit for the day will be 100.I hope it makes more sens with different numbers.
So basically, the robot will never stop trading until it reaches the daily goal.
Is that possible?
Thanks again!
Jo
06/11/2022 at 8:37 AM #195120Sorry, I forgot to attach the modified code.
Now I added the last modifications requested, so that it keeps trading till 100 pips have been reached. Each new day it will restart from scratch:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859DEFPARAM CumulateOrders = False//ONCE CrossOver = 0IF IntraDayBarIndex = 0 THENCrossOver = 0Tally = 0TradeON = 1ENDIFTally = Tally + ((StrategyProfit - StrategyProfit[1]) / PipValue)indicator1 = ExponentialAverage[20](close)indicator2 = ExponentialAverage[2000](close)IF (indicator1 CROSSES OVER indicator2) OR (indicator1 CROSSES UNDER indicator2) THENCrossOver = 1ENDIFc1 = (indicator1 > indicator2)c2 = (indicator1 < indicator2)ONCE MyGOAL = 100 //100 pips DailyIF OnMarket AND (Tally + ((PositionPerf * PositionPrice / PipSize)) >= (MyGOAL * PipSize)) THENSELL AT MarketEXITSHORT AT MarketTradeON = 0ENDIF// Formula floatingprofit//floatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsizeTimeframe (default)//// Conditions to enter longIF NOT LongOnMarket AND c1 AND TradeON AND CrossOver THENBUY 1 CONTRACT AT MARKETENDIF// Conditions to exit a buy positionIf LongOnMarket AND c2 THENSELL AT MARKETENDIF// Conditions to enter shortIF NOT ShortOnMarket AND c2 AND TradeON AND CrossOver THENSELLSHORT 1 CONTRACT AT MARKETENDIF// Conditions to exit a sell positionIF ShortOnMarket AND c1 THENEXITSHORT AT MARKETENDIF////graph floatingprofit//graph Moneygraph (Tally + (PositionPerf * PositionPrice / PipSize)) coloured(255,0,0,255)graph TradeON//graph c1//graph c2graphonprice indicator1 coloured(255,0,0,255) AS "Ema20"graphonprice indicator2 coloured(0,0,255,255) AS "Ema200"1 user thanked author for this post.
06/11/2022 at 9:35 AM #195125 -
AuthorPosts
Find exclusive trading pro-tools on