730 questions
0
votes
0
answers
20
views
The problem of not receiving an alarm when there is an intersection in the indicator
Even though there is the intersection I want in the tradingview indicator(" ULUDAĞ SAR+LINEAR 2 ",overlay=true) indicator and the intersection text is written on the screen, the alarm is not ...
1
vote
0
answers
30
views
Can I annotate a strategy-pattern class-factory using JSDoc?
Essentially I have the following inheritance chain:
Chainable -> Strategy -> Actions
Actions are used at the call-site returning a chainable API:
await actionMaker()
.action1()
.action2()
...
0
votes
0
answers
22
views
How to define versioning strategy of software product including several modules with its own version?
Our software team has released software product several customers(B2B) continuously.
Software product includes several children modules(8EA) like below.
S/W Product: 0.0.0.0
ㄴ Module A: 0.0.0.0
ㄴ ...
0
votes
0
answers
20
views
Understanding Inconsistent Results in Pine Script
This Pine code give us strange results for example it gives us t = 0 , Result = 6552 , close = 6593, so why ( t = close - Results ) give us 0 which is correct, but There is so difference between ...
0
votes
4
answers
135
views
Strategy pattern to filter objects, how to compose them?
Say I have come class that looks like this
class Product {
double Price;
String name;
String category;
}
I have a client facing API that allows users to filter my list of objects based on ...
0
votes
0
answers
69
views
Code Snippet : Bridge Pattern or Strategy Pattern? [duplicate]
The following code is an example of Strategy Design Pattern or Bridge Design Pattern.
If Strategy , why not Bridge and vice-versa. I am quite confused after reading different articles and comments. ...
0
votes
0
answers
60
views
esp32 rssi based tracking - Consultation
I am trying to build an asset tracking solution with esp32. I am looking out here for an optimal strategy, than an answer to a specific question.
I've set 3 esp's as anchors, and I have another 5 esp'...
0
votes
1
answer
139
views
Design approach for safely picking between multiple payment methods
We need to dynamically support multiple payment methods (credit, paypal, google pay, etc...).
We can change the gateway we use to implement a certain payment method.
For example:
PayPal payment method ...
0
votes
1
answer
134
views
Type mismatch in Kotlin when using strategy pattern with generics
I need to implement a backend system which accepts multiple payment methods, and then process them according to their type.
I used Strategy Pattern, but I can't seem to make it work when I initialize ...
0
votes
0
answers
38
views
How can I implement an object of strategies with same API but that only the provided argument options differ for each strategy?
Right now I am struggling with pleasing TypeScript compiler when using generics.
I am trying to implement a strategy pattern selector using a JavaScript object. Every strategy shares the same API with ...
0
votes
1
answer
251
views
Pine script version change and stop reprint and repaint issue
Here is a very small pine script that follows trend but I'm facing issue with this repaint and reprint issue.
//@version=2
strategy("PrabhuTrendStrategy", overlay=true)
tim=input('160')
...
0
votes
1
answer
108
views
How to use mutable references as arguments for generic functions in rust [duplicate]
I am attempting to practice using the stratergy pattern and thought to sort a vector using a function selected at runtime, ideally being able to change the data in place using a mutable reference.
I ...
-2
votes
1
answer
186
views
Why my strategy doss not execute in tradingview? it creates no trade? caution! this strategy did not generate any orders throughout the testing range
`//@version=5 strategy("4:4 S1", overlay=true) // Indicator Inputs fairValueGap = input(0.5, "Lux Algo Fair Value Gap") cciLevel = input(100, "CCI Level") cci = ta.cci(...
0
votes
0
answers
249
views
How do you implement the strategy pattern using Flutter and Riverpod?
In my Flutter app, there is a page that loads the data for a given topic. Included in this topic is an identifier for the algorithm to use when the user interacts with the widget. Due to the nature of ...
2
votes
1
answer
79
views
Is this Command Pattern or Strategy Pattern?
This is an image from an old exam I'm working through. Through the UML-diagram, as seen above, how can I determine if this is Command Pattern or Strategy Pattern?
The answer to the question is that is ...
1
vote
6
answers
627
views
How to conditionally select concrete implementation for strategy pattern using Dependency Injection C#
I am trying to understand the Strategy Pattern in order to utilise it for a problem I have.
The current code looks as such where I have an amount that I want to process based on a payment type.
public ...
0
votes
1
answer
112
views
The issue is that it should show the price values (coordinates) from which the line comes on a price scale, not on a graph! How to fix it?
The indicator on the chart displays multiple high/low price indicators, even if the asset price simply breaks it. Price values are displayed as a comment on the chart, but they need to be displayed ...
0
votes
1
answer
70
views
Implement Strategy pattern with Guice DI
I am very new in Guice DI. I am trying to implement a Strategy pattern with Guice. But I am confused on, How to inject different types of Strategy Implementations in the Context class through Guice DI....
1
vote
1
answer
50
views
How to run different logic from Master page for different tab in TabContainer
In my app, we have master page which has some common features like export to excel, pdf etc.
On content page, I have TabContainer with multiple tabs.
When I run option like export to excel, Master ...
0
votes
0
answers
24
views
Java i can not initalize reference varibale in subclass because "VariableDeclaratorId expected after this token"
I have created an interface Flyable and the class FlyableWithWing implementing this interface
public interface Flyable {
void fly();
}
public class FlyWithWings implements Flyable {
@Override
...
0
votes
1
answer
214
views
How to dynamically choose what concrete class to use in dependency injection
I usually write something like this for my DI:
var serviceProvider = new ServiceCollection()
.AddSingleton<ISomething, Something>()
.AddSingleton<IOutputMaker, ...
-1
votes
1
answer
781
views
MACD + histogram default tradingview
Hello can anyone help me I'm new at making indicators can anyone give me the default code of the macd in tradingview like with the histogram color buying or selling pressure weakening. thanks
I've ...
-3
votes
1
answer
667
views
Stopped - Too many triggering error Tradingview . Why is this happening?
In the strategy I created; This is how the Strategy Login and Exit alarms fail.
How can I solve this problem? The strategy uses pyramiding.
enter image description here
enter image description here
...
-2
votes
1
answer
123
views
How to convert pine script to strategy & generate alerts
The below script is working fine and is generating signals, but not able to convert this into strategy and generate signals
study("Trend Magic", shorttitle="TM", overlay=true)
CCI =...
0
votes
1
answer
296
views
Cannot access dependency injected inside strategy pattern implementation class
I am trying to implement the strategic pattern,the problem is that I could not access any dependency injected inside the strategy implmentation classes, so here is my code
Payment strategy interface
...
0
votes
2
answers
50
views
I cannot print text on the screen with the command " Macd Line == Signal Line " . How can I do it?
I cannot print text on the screen with the command " Macd Line == Signal Line " . How can I do it ?
I am using these codes. It's actually very simple, but I couldn't transfer it to the ...
3
votes
1
answer
576
views
Alternatives to State Design Pattern
So I have been reading some design patterns on refactoring.guru, and have especially had an interest in behavioral design patterns.
However, there is one design pattern that made me question if it is ...
1
vote
2
answers
162
views
Issues with Strategy Pattern in c++
i'm implementing a neural network with "LEARNING PURPOSES".
Y have the following templated classes:
a Optimizer Base class with virtual method update taking a Parameter class reference as ...
0
votes
1
answer
127
views
I want to use "once per bar" feature in Strategy inputs as in Indicator. What should I do?
I want to use "once per bar" feature in Strategy inputs as in Indicator. What should I do?
I want the strategy to be traded immediately as in the indicator without waiting for the candle to ...
0
votes
2
answers
1k
views
How can I enter the trade without waiting for candle closing in Pinescript Strategy?
I have a strategy based on rsi , macd , ema and ADX. I trade with small profit rates. But when the conditions are met, it enters the trade at the close of the candle. I want it to be processed as soon ...
2
votes
1
answer
257
views
Why is the Strategy design pattern applicable when reducing the cyclomatic complexity of the code?
The Strategy Design pattern, from the book Design patterns written by the Gang of Four, has the following statement in the Consequences section:
Strategies eliminate conditional statements. The ...
0
votes
2
answers
70
views
Can not manage to call child methods in a strategy pattern
I am stuck on a strategy pattern implementation.
I would like the child classes methods implementing the strategy pattern to be called, but it seems that it is only the abstract class method that is ...
0
votes
1
answer
169
views
Rust equivalent of Java Consumer interface for Strategy pattern
I will provide a practical example.
I want to create an event logger. I define an event as an Interface:
import java.util.function.Consumer;
interface Event {}
class BuyEvent implements Event {}
...
1
vote
1
answer
53
views
How to open trade after 3 candles since last trade was closed?
I am having trouble with my strategy. It opens and closes trades in the same exact time sometimes. I need the strategy to wait 3 candles before it can close trade, then wait another 3 candles before ...
-1
votes
2
answers
366
views
How to avoid duplicate code while using Strategy Design Pattern?
I am new to design patterns and thinking about using Strategy design pattern for implementing code in my backend service. However, the Strategies are having duplicate code. I have the following ...
0
votes
0
answers
34
views
from package import * - strategy to avoid importing everything in python [duplicate]
I know that it is not a good idea to use the from package import * syntax in python to import everything from a package. I want a strategy to avoid importing everything, just those items that are ...
0
votes
1
answer
208
views
How to decide a std::vector Type in runtime depends on loop elements type?
I have a list of my own data types, I want to convert it to std::vector of primitive type (int8_t/int/...).
I want to create a vector of primitive type (int32/int8) that will be choosen in runtime ...
0
votes
1
answer
967
views
Similar components with different business logic in Angular
I have a question about good practice in Angular. I need to create 2 similar components with the exact same look but in different logic i.e. one of them working locally in the browser, another one, ...
0
votes
1
answer
174
views
How to keep track of opened positions and close conditionally in Pine Script Bollinger Grid strategy
I want to have up to 3 longs or 3 shorts. To keep track what positions I have opened, I have control variables defined at the beginning.
Description of Bollinger Grid Strategy:
Use 3 Bollinger bands ...
1
vote
1
answer
123
views
Design patterns without the box
Rust beginner here. I have a number of algorithms that are almost identical but, at the final step, they all aggregate the results in slightly differently ways. Let's say the Algorithm does the ...
1
vote
1
answer
27
views
Is it appropriate to use pattern Strategy in this task?
I have a task to build a program that calculates taxes from the person. For example, some taxes are calculated the same, so can I relate it to Strategy pattern?
I think I can create a lot of classes ...
1
vote
1
answer
142
views
BST for storing student information and strategy pattern implementation
I'm trying to implement a binary search tree for storing student data such as first name, last name, id, and GPA and apply some strategy patterns to them. I'm not able to understand how to insert ...
0
votes
0
answers
90
views
Strategy & builder design patterns and templates in C++
The following is the geometry class, which handles storing and manipulating vertex and index information of a particular 3-dimensional object.
class geometry {
public:
geometry();
~geometry();
...
2
votes
3
answers
3k
views
How Do I remove strategies from strategy tester in tradingvew?
I've tried several strategies and now I want to delete them all but it is no way to do it and no help or youtube or google can answer that. Please help!
1
vote
1
answer
295
views
Dynamically add controls in ASP.NET: factory pattern design pattern?
I am trying to understand how I can get this JSON data into a factory pattern design pattern. The JSON data below have two MeetingPollingQuestionType one for LongAnswerText and one for MultipleChoice. ...
1
vote
1
answer
1k
views
Where to write the common logic in Java Strategy design pattern? [closed]
This is related to Java Strategy design pattern.
In Strategy pattern, we create objects which represent various strategies and a context object whose behavior varies as per its strategy object.
I have ...
1
vote
2
answers
152
views
How to achieve encapsulation in C++ project
I'm currently learning about OOP design patterns and I'm working on a project whose main class is roughly organized as follows:
class MainClass {
public:
MainClass(int something, ...
0
votes
2
answers
102
views
Question on diamond operator for design pattern strategy
Small question regarding the diamond operator and design pattern strategy for Java, please.
I would like to implement a very specific requirement:
there are some objects to store (in my example ...
-1
votes
1
answer
278
views
Want to access previous trades data before entering a new data
I want to access trades data of last 3 months in pine script before entering a new date , how can i do that
1
vote
3
answers
108
views
How do I implement the open-close principle?
My intention is to describe the architecture of a tennis court management software with a class diagram, keeping the open-closed principle.
Initially, the software should only provide the following ...