Stratégie Dow M1 Midnight Candle
Forums › ProRealTime English forum › ProOrder support › Stratégie Dow M1 Midnight Candle
- This topic has 3 replies, 3 voices, and was last updated 1 year ago by GraHal.
-
-
04/30/2023 at 7:55 PM #213913
Hello, I have a code for a very simple strategy.
Strategy :
At the close of the midnight candle, I draw a line on the highest point and on the lowest point of it.
Lorsqu’une bougie d’achat est franchie et se ferme au-dessus de la ligne du point le plus élevé, je prends un ordre d’achat.Lorsqu’une bougie de vente perce et se ferme sous la ligne du point bas, je passe un ordre de vente.À chaque position, le stop-loss est placé à 50 points et le take profit à 100 points.Il est possible que le graphique ait un ordre d’achat et de vente en même temps.Cette stratégie est applicable sur l’unité de temps de 1 minute.Je recommencerais le code chaque jour en entrant les valeurs de la bougie la plus haute et la plus basse (par défaut 1440 sur ce code).When a buy candle is crossed and closes above the high point line, I place a buy order.
When a sell candle breaks through and closes below the low line, I place a sell order.
At each position, the stop-loss is placed at 50 points and the take profit at 100 points.
It is possible that the chart has a buy and sell order at the same time.
This strategy is applicable on 1 minute timeframe.
I would start the code over each day by entering the values of the highest and lowest candle (default 1440 on this code).
12345678910111213141516171819202122232425262728293031323334353637383940414243444546// Déclaration des variablesvars: MaxHigh(0), MinLow(0), BuySignal(False), SellSignal(False), StopLoss(0), TakeProfit(0);// Récupération de la valeur du pointvalue1point = Point;// Si on est sur la bougie de minuit, on trace le trait horizontalif Time = 0000 then begin// Calcul du point le plus haut et du point le plus bas de la bougieMaxHigh = Highest(High, 1440);MinLow = Lowest(Low, 1440);// Dessin des lignes horizontalesDrawLine("MaxHigh", 0, MaxHigh, 1440, MaxHigh, Blue);DrawLine("MinLow", 0, MinLow, 1440, MinLow, Red);end;// Si une bougie acheteuse franchit la ligne horizontale du point le plus hautif Close crosses above MaxHigh and not SellSignal then begin// On prend une position à l'achatBuySignal = True;SellSignal = False;StopLoss = Close - 50 * value1point;TakeProfit = Close + 100 * value1point;Buy next bar at Close stop;end;// Si une bougie vendeuse franchit la ligne horizontale du point le plus basif Close crosses below MinLow and not BuySignal then begin// On prend une position à la venteSellSignal = True;BuySignal = False;StopLoss = Close + 50 * value1point;TakeProfit = Close - 100 * value1point;Sell short next bar at Close stop;end;// Gestion des positions ouvertesif MarketPosition = 1 then begin // Position à l'achatSetStopLoss(StopLoss);SetProfitTarget(TakeProfit);endelse if MarketPosition = -1 then begin // Position à la venteSetStopLoss(StopLoss);SetProfitTarget(TakeProfit);end;Comme vous pouvez le voir, j’ai des messages d’erreur et je ne trouve pas d’où ça vient …Avez-vous une idée du problème? MerciAs you can see, I have error messages and I can’t find where it comes from…
Do you have an idea of the problem? Thanks
04/30/2023 at 8:06 PM #213915Hello, I have a code for a very simple strategy.
Strategy :
At the close of the midnight candle, I draw a line on the highest point and on the lowest point of it.
<span class=”HwtZe” lang=”en”><span class=”jCAhz ChMk0b”><span class=”ryNqvb”>When a buy candle is crossed and closes above the high point line, I place a buy order.</span></span> </span>
<span class=”HwtZe” lang=”en”><span class=”jCAhz ChMk0b”><span class=”ryNqvb”>When a sell candle breaks through and closes below the low line, I place a sell order.</span></span> </span>
<span class=”HwtZe” lang=”en”><span class=”jCAhz ChMk0b”><span class=”ryNqvb”>At each position, the stop-loss is placed at 50 points and the take profit at 100 points.</span></span> </span>
<span class=”HwtZe” lang=”en”><span class=”jCAhz ChMk0b”><span class=”ryNqvb”>It is possible that the chart has a buy and sell order at the same time.</span></span> </span>
<span class=”HwtZe” lang=”en”><span class=”jCAhz ChMk0b”><span class=”ryNqvb”>This strategy is applicable on the time unit of 1 minute.</span></span> </span>
<span class=”HwtZe” lang=”en”><span class=”jCAhz ChMk0b”><span class=”ryNqvb”>I would start the code over each day by entering the values of the highest and lowest candle (default 1440 on this code).</span></span></span>
<span class=”HwtZe” lang=”en”><span class=”jCAhz ChMk0b”><span class=”ryNqvb”>As you can see, I have error messages and I can’t find where it comes from…</span></span> <span class=”jCAhz ChMk0b”><span class=”ryNqvb”>Do you have an idea of the problem?</span></span> <span class=”jCAhz ChMk0b”><span class=”ryNqvb”>THANKS</span></span></span> 🙂
04/30/2023 at 8:37 PM #213916I got your code to run by correcting many syntax errors etc.
If you want to see my changes then copy and paste your code and my code into this …
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647DEFPARAM CUMULATEORDERS = False// Déclaration des variables//vars: MaxHigh(0), MinLow(0), BuySignal(False), SellSignal(False), StopLoss(0), TakeProfit(0);// Récupération de la valeur du pointvalue1point = pipsize //Pont //;// Si on est sur la bougie de minuit, on trace le trait horizontalif Time = 000000 then //begin// Calcul du point le plus haut et du point le plus bas de la bougieMaxHigh = Highest[1440](High) //, 1440);MinLow = Lowest[1440](Low) //, 1440);// Dessin des lignes horizontales//DrawLine("MaxHigh", 0, MaxHigh, 1440, MaxHigh, Blue);//drawLine("MinLow", 0, MinLow, 1440, MinLow, Red);endIF //;// Si une bougie acheteuse franchit la ligne horizontale du point le plus hautif Close crosses OVER MaxHigh and not SellSignal then // begin// On prend une position à l'achatBuySignal = 1 //True //;SellSignal = 0 //False;StopLoss = Close - 50 * value1point //;TakeProfit = Close + 100 * value1point //;Buy at Close stop //;endIF //;// Si une bougie vendeuse franchit la ligne horizontale du point le plus basif Close crosses UNDER MinLow and not BuySignal then //begin// On prend une position à la venteSellSignal = 1 //True //;BuySignal = 0 //False;StopLoss = Close + 50 * value1point //;TakeProfit = Close - 100 * value1point //;Sellshort at Close stop //;endIF //;// Gestion des positions ouvertesif CountofPosition = 1 then //begin // Position à l'achatSet Stop Loss(StopLoss) //;Set Target Profit (TakeProfit)//;endIFIf CountofPosition = -1 then //begin // Position à la venteSet Stop Loss(StopLoss) //;Set Target Profit(TakeProfit) //;endif //;04/30/2023 at 9:32 PM #213919 -
AuthorPosts
Find exclusive trading pro-tools on