工作已完成
指定
Hello,
I have a simple pine script that needs to be converted into an EA.
//@version=4 strategy(title="HIGHER HIGH LOWER LOW STRATEGY", shorttitle="HH LL STRATEGY", overlay=true, initial_capital=1000, default_qty_type=strategy.contracts, currency="EUR") //Higher High or Lower Low Entry Inputs price = input(close) LookBack = input(41) Highest = highest(LookBack) Lowest = lowest(LookBack) long = price > Highest[1] short = price < Lowest[1] //Safety Confirmation Inputs - Helps to thin out false breakouts or break downs length = input(10) High_Guard = highest(length) Low_Guard = lowest(length) length2 = input(1) long1 = long == 1 and Highest[1] > High_Guard[length2] short1 = short == 1 and Lowest[1] < Low_Guard[length2] strategy.entry("Long", strategy.long, when=long1) strategy.entry("Short", strategy.short, when=short1)
This script should have the following functions:
-Same entries showing up on chart like in TradingView (past ones as well) (then you can check if the mql EA behaves exactly like the pine script above)
-showing entries that are taken by the EA
-Starting capital should be read from account balance, same for currency that is used
-LotSize input - how much I want to use for trades, from 0,01 to 0,1 to 1 (of course I can set 0,3 as well and so on)
-Automatic trade execution (for example - EA opens long position, after the next signal appears a short position will be opened where the long position is automatically closed and viceversa, only ONE position can be taken)
SourceCode included of course