TradingView
allanster
11 พฤษภา 2020 เวลา 8 นาฬิกา 56 นาที

How To Limit n Round Trips Per Day [Alerts] 

Bitcoin / United States DollarCoinbase

คำอธิบาย

Example how to limit the number of round trips per day. If entry condition is never met logic will force a round trip at end of day. Set chart to a timeframe that is lower than 1 Day period.


NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!

เอกสารเผยแพร่

Added option to view modulated background color for each day. Updated for Pine Script v5.
ความคิดเห็น
FaizanNawazz
Hello sir i just came across your script , would like to ask , i want to set limit alerts on my indicator which is normal ema high low , for example once 2 buy or 2sell alerts are triggered no more alert should get trigger even if the entry condition is met multiple times , basically want to take 2 trades perday, is there a way where we can limit alerts ?
allanster
@FaizanNawazz, currently I think controlling frequency of alerts per day can only be done by using script logic, which is what this script does. The default setting for inputN is 2 which would provide 2 round trips per day. One thing to note is that this particular example was designed to work on 24/7 sessions. For use on other types of sessions the logic for nbpDay (number of bars per day) would need to be adjusted accordingly.
rajeshshivramshetty_2
Sir u mean to say that by including this above code in our script ...we will avoid multiple alerts of the same scripts ...i.e the alert will appear only once throughout the day even if the conditions are met multiple times. Is my interpretation correct ?
allanster
@rajeshshivramshetty, correct except if entry condition is never met then logic will force a round trip at end of day.
RupeshSuvarna
Hi Allanter,

Appreciate your efforts, I believe it needs some script change as in every time frame it doesn't show Entry / Enter Signal.
allanster
@RupeshSuvarna, I am unable to reproduce the behavior you are describing. I just retested with each timeframe below 1 day and script behavior is as intended. As noted in script description above you must 'Set chart to a timeframe that is lower than 1 Day period.'
Vetesh
I really need this, thank you, but when i add, its showing only the MA not the signal
allanster
@Vetesh, as per description above, to function properly the script requires setting chart to a timeframe that is lower than 1 Day period. Once you do this the other items will appear.
Pratik_4Clover
This was really needed, thank you!
allanster
@OWL, thanks for your interest!
เพิ่มเติม