Tarea técnica

// Forex Strategy for Consistency in Profit

// Input parameters
input int FastMAPeriod = 10; // Period for the fast moving average
input int SlowMAPeriod = 30; // Period for the slow moving average
input double StopLossPips = 50; // Stop loss in pips
input double TakeProfitPips = 100; // Take profit in pips

// Global variables
int ticket = 0; // Order ticket number

// Indicator buffers
double fastMABuffer[];
double slowMABuffer[];

// Initialization function
int OnInit()
{
    // Define indicator buffers
    SetIndexBuffer(0, fastMABuffer);
    SetIndexBuffer(1, slowMABuffer);
    
    // Set indicator plot type
    SetIndexStyle(0, DRAW_LINE);
    SetIndexStyle(1, DRAW_LINE);
    
    // Set indicator colors
    SetIndexLabel(0, "Fast MA");
    SetIndexLabel(1, "Slow MA");
    SetIndexDrawBegin(0, SlowMAPeriod);
    SetIndexDrawBegin(1, SlowMAPeriod);
    
    // Set indicator parameters
    SetIndexShift(0, 0);
    SetIndexShift(1, 0);
    SetIndexEmptyValue(0, 0);
    SetIndexEmptyValue(1, 0);
    
    // Return successful initialization
    return INIT_SUCCEEDED;
}

// Trading function
void OnTick()
{
    // Calculate moving averages
    ArraySetAsSeries(fastMABuffer, true);
    ArraySetAsSeries(slowMABuffer, true);
    int fastMA = iMA(Symbol(), 0, FastMAPeriod, 0, MODE_SMA, PRICE_CLOSE);
    int slowMA = iMA(Symbol(), 0, SlowMAPeriod, 0, MODE_SMA, PRICE_CLOSE);
    
    // Check for a crossover
    if (fastMA > slowMA && fastMABuffer[1] <= slowMABuffer[1])
    {
        // Close any existing positions
        if (ticket > 0 && OrderSelect(ticket, SELECT_BY_TICKET))
        {
            if (OrderClose(ticket, OrderLots(), OrderClosePrice(), Slippage, Red))
            {
                ticket = 0; // Reset ticket number
            }
        }
        
        // Open a new buy position
        ticket = OrderSend(Symbol(), OP_BUY, 0.1, Ask, Slippage, Ask - StopLossPips * Point, Ask + TakeProfitPips * Point, "Buy Order", 0, 0, Green);
    }
    else if (fastMA < slowMA && fastMABuffer[1] >= slowMABuffer[1])
    {
        // Close any existing positions
        if (ticket > 0 && OrderSelect(ticket, SELECT_BY_TICKET))
        {
            if (OrderClose(ticket, OrderLots(), OrderClosePrice(), Slippage, Red))
            {
                ticket = 0; // Reset ticket number
            }
        }
        
        // Open a new sell position

        ticket = OrderSend(Symbol(), OP_SELL, 0.1, Bid, Slippage, Bid + StopLossPips * Point, Bid - TakeProfitPips * Point, "Sell Order


Han respondido

1
Desarrollador 1
Evaluación
(42)
Proyectos
62
8%
Arbitraje
12
58% / 42%
Caducado
1
2%
Libre
2
Desarrollador 2
Evaluación
(24)
Proyectos
29
24%
Arbitraje
3
67% / 33%
Caducado
6
21%
Libre
3
Desarrollador 3
Evaluación
(2)
Proyectos
2
0%
Arbitraje
1
0% / 0%
Caducado
2
100%
Libre
4
Desarrollador 4
Evaluación
(454)
Proyectos
513
33%
Arbitraje
26
38% / 46%
Caducado
7
1%
Trabajando
5
Desarrollador 5
Evaluación
(568)
Proyectos
641
41%
Arbitraje
21
57% / 29%
Caducado
47
7%
Trabaja
6
Desarrollador 6
Evaluación
(5)
Proyectos
4
50%
Arbitraje
4
0% / 75%
Caducado
0
Libre
Solicitudes similares
I am looking for an experienced Forex trading expert to help me configure, set up, and run a fully automated trading account. I am new to Forex trading and am eager to learn, so I am seeking someone who can not only set up the account but also provide guidance and education throughout the process
I have an EA that works with GRID, very simple strategy. THE JOB - This current EA is not closing both sides when TP is reached so would like to make this function work. The strategy : The Expert will start and generate a position of buy\sell at the same time when added to chart. The frist and last positions are considered scalping positions with a smaller TP just for the purpose of generating IB comisisons. After
hi. I hv a strategy on tradingview need to convert to MT4/MT5 expert advisor for algo trading. would like to add some tradingview strategy setting to the EA(not included in my tradingview code): recalculate after order is filled, order size: xx% of equity
Hello great developer i need a great developer that can help me to do the modification on Ninjatrader https://forum.ninjatrader.com/forum/ninjatrader-7/general-development/44785-real-time-data-feed-from-excel-sheet Need a simple tool to connect rt data from excel to Ninjatrader- Already a free tool available which extracts data from trading software called- Nest Trader - to Ninjatrader- Its possible to modify it to
Hello I would like to replicate ThinkTrader desktop version indicators to be used in MT4 . The indicators are 1) Trendrisk Trend and 2) Supertrend. These indicators will paint the candlestick of the chart. thanks
1. Combination of Market Profiles on daily basis a) this should be combined if the bell curve is similar to the previous day. Rotational day (volume - standard deviation). b) If breakout, new range should be drawn Conclusion: Market profile should be combined on daily after the market is closed 2. Use Vwap indicator, with 0.5 - slow trend, 1.0 - normal trend, 1.5 fast trend. The stop loss should be under the trend
"I am looking to automate my Delta Divergence trading strategy for NinjaTrader 8. The strategy is thoroughly detailed in the accompanying script, and I need it to be implemented effectively in the platform."
Forex trading market opening an account for the first time, modify you system of forex , always there for everyone,you are all welcome and for info on all platforms @ lil_johnny254 there to serve you
I need an urgent requirement by the developer who are able expert in designing the EA-Anil and can give best trailing result of profit in EA-Anil I am sending.Developer should design the best graphic user trader panel info, plus a buy sell input panel and should display trade result within 4-5 days of this development program
I’m looking for a developer that has understanding of scalping and HFT strategies that can make an algo that works for all brokers and prop firm LIVE accounts (like STP, ECN, DMA, Money Makers, NDD, Fast Server etc.,). I want someone that has understanding and insight in different scalping and HFT strategies, preferably something like momentum based strategies. The EA has to work on all Brokers and Prop firms like

Información sobre el proyecto

Presupuesto
30+ USD
Para el ejecutor
27 USD
Plazo límite de ejecución
de 1 a 30 día(s)